Skip to content

Commit db1a03d

Browse files
authored
Merge pull request #12946 from GitHubber17/262389-c
Freshness: Visual Studio 17.10
2 parents fbee61c + b669c09 commit db1a03d

File tree

3 files changed

+60
-38
lines changed

3 files changed

+60
-38
lines changed

docs/ide/dotfuscator/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ See [the full Dotfuscator Community User Guide at preemptive.com][full] for deta
383383
[attributes-checks]: https://www.preemptive.com/dotfuscator/ce/docs/help/attributes_checks.html
384384
[attributes-obfuscation]: https://www.preemptive.com/dotfuscator/ce/docs/help/attributes_obfuscation.html
385385

386-
[verbosity]: ../how-to-view-save-and-configure-build-log-files.md#to-change-the-amount-of-information-included-in-the-build-log
386+
[verbosity]: ../how-to-view-save-and-configure-build-log-files.md#specify-data-verbosity-for-build-logs
387387
[dotnet-attributes]: /dotnet/standard/attributes
388388
[application-insights]: /azure/azure-monitor/app/app-insights-overview
389389
[nuget-org]: https://www.nuget.org/
Lines changed: 58 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,100 @@
11
---
2-
title: 'View, save, and configure build log files'
3-
description: View, save, and configure build log files that contain information such as the command lines used for the compiler and other tools, and troubleshoot build failures.
4-
ms.date: 11/11/2022
2+
title: View, save, and configure build log files
3+
description: Explore how to configure build log files with information about the compiler and other tools for troubleshooting build failures.
4+
ms.date: 08/21/2024
55
ms.subservice: compile-build
66
ms.topic: how-to
77
author: ghogen
88
ms.author: ghogen
99
manager: mijacobs
10+
11+
#customer intent: As a developer, I want to work with build log files in Visual Studio so I can troubleshoot build failures.
1012
---
13+
1114
# View, save, and configure build log files
1215

13-
After you build a project in the Visual Studio IDE, you can view information about that build in the **Output** window. By using this information, you can troubleshoot a build failure, view the exact command lines used for all the build tools, or get full diagnostic information about the entire build process.
16+
After you build a project in the Visual Studio Interactive Development Environment (IDE), you can view logged information about the build in the Visual Studio **Output** window. The output data can be saved to log files that you can view in Visual Studio and other editors.
17+
18+
The logs can help you troubleshoot issues in the build. You can locate the exact command lines used for all build tools, and get full diagnostic data about the entire build process. Visual Studio provides options to specify the kinds of information you want to see in the build output and build log files.
19+
20+
This article describes how to generate, configure, and view build log files in Visual Studio.
21+
22+
## Generate and view build log files
23+
24+
Use the following procedures to generate and view build log files for your scenario.
1425

15-
- For C++ projects, you can also view the same information in a log file that's created and saved when you build a project.
26+
- **C++ project**:
1627

17-
- For .NET projects, you can click in the build output window and press **Ctrl**+**S**. Visual Studio prompts you for a location to save the information from the **Output** window into a log file.
28+
Visual Studio saves the log files for you when you build your project. Common locations for the log files include *Release\\\<ProjectName>.log*, *Debug\\\<ProjectName>.log*, and *\<ProjectName>.txt*. All file locations are relative to your project root folder and based on your specific configuration.
1829

19-
You can also use the IDE to specify what kinds of information you want to view about each build.
30+
1. Use **Windows Explorer** or **File Explorer** to browse to the log file.
31+
32+
1. Open the log file in your preferred editor.
2033

21-
If you build any kind of project by using MSBuild, you can create a log file to save information about the build. For more information, see [Obtain build logs](../msbuild/obtaining-build-logs-with-msbuild.md).
34+
- **.NET project**:
2235

23-
## To view the build log file for a C++ project
36+
For .NET projects, you instruct Visual Studio to save the log files:
2437

25-
1. In **Windows Explorer** or **File Explorer**, open the following file (relative to the project root folder): *Release\\{ProjectName}.Log* or *Debug\\{ProjectName}.log*
38+
1. In Visual Studio, select **Build** > **Build Solution**.
2639

27-
## To create a build log file for a managed-code project
40+
1. In the **Output** window, select in the text and use the **Ctrl**+**S** keyboard shortcut.
41+
42+
Visual Studio prompts you for a location to save the build output. You can then open the log files from that location in Visual Studio or another editor.
2843

29-
1. On the menu bar, choose **Build** > **Build Solution**.
44+
- **MSBuild**:
3045

31-
2. In the **Output** window, click somewhere in the text.
46+
You can generate build logs by running MSBuild directly from the command line by using the `-fileLogger` (`-fl`) command-line option. For more information, see [Obtain build logs with MSBuild](../msbuild/obtaining-build-logs-with-msbuild.md).
3247

33-
3. Press **Ctrl**+**S**.
48+
## Specify data verbosity for build logs
3449

35-
Visual Studio prompts you for a location to save the build output.
50+
You can specify how much information to include in the build log files. The amount of data in the log file columns is measured as *logger verbosity*. The number of log file rows represent *messages collected*. The log verbosity (column values) affects the types of logged messages (row values). **Quiet** verbosity produces minimal logging in the build output. **Diagnostic** is the most verbose setting and generates log files with all possible data.
3651

37-
You can also generate logs by running MSBuild directly from the command line, using the `-fileLogger` (`-fl`) command-line option. See [Obtain build logs with MSBuild](../msbuild/obtaining-build-logs-with-msbuild.md).
52+
The following table shows what types of messages are collected based on the logger verbosity:
3853

39-
## To change the amount of information included in the build log
54+
| Message type / Verbosity | Quiet | Minimal | Normal | Detailed | Diagnostic |
55+
|------------------------------------|:-----:|:-------:|:------:|:--------:|:----------:|
56+
| Errors ||||||
57+
| Warnings ||||||
58+
| High-importance messages | |||||
59+
| Normal-importance messages | | ||||
60+
| Low-importance messages | | | |||
61+
| Other MSBuild-engine information | | | | ||
4062

41-
1. On the menu bar, choose **Tools** > **Options**.
63+
You can configure the logger verbosity with the following steps:
4264

43-
2. On the **Projects and Solutions** page, choose the **Build and Run** page.
65+
1. In Visual Studio, select **Tools** > **Options** to open the **Options** dialog.
4466

45-
3. In the **MSBuild project build output verbosity** list, choose one of the values, and then choose the **OK** button.
67+
1. On the dialog, expand the **Projects and Solutions** section and select the **Build and Run** tab.
4668

47-
The following table shows how the log verbosity (column values) affects which types of message (row values) are logged.
69+
1. Use the **MSBuild project build output verbosity** dropdown list and select your build output preference.
4870

49-
| Message type / Verbosity | Quiet | Minimal | Normal | Detailed | Diagnostic |
50-
|---------------------------------------|:-----:|:-------:|:------:|:--------:|:----------:|
51-
| Errors ||||||
52-
| Warnings ||||||
53-
| High-importance Messages | |||||
54-
| Normal-importance Messages | | ||||
55-
| Low-importance Messages | | | |||
56-
| Additional MSBuild-engine information | | | | ||
71+
1. Use the **MSBuild project build log file verbosity** dropdown list and select your logger verbosity preference.
5772

58-
If you want to see the command lines used for the compiler and other tools, choose at least the **Detailed** verbosity level.
73+
> [!TIP]
74+
> If you want to see the command lines used for the compiler and other tools, choose at least the **Detailed** verbosity level.
5975
60-
For more information, see [Options dialog box, Projects and Solutions, Build and Run](../ide/reference/options-dialog-box-projects-and-solutions-build-and-run.md) and <xref:Microsoft.Build.Framework.LoggerVerbosity>.
76+
1. To apply your changes, select **OK**.
6177

6278
> [!IMPORTANT]
63-
> You must rebuild the project for your changes to take effect in the **Output** window (all projects) and the *\<ProjectName>.txt* file (C++ projects only).
79+
> You must rebuild the project for your changes to take effect in the **Output** window. For C++ projects, the project rebuild also ensures the changes are reflected in the *\<ProjectName>.txt* file.
6480
65-
## Use binary logs to make it easier to browse large log files
81+
For more information, see [Options dialog box, Projects and Solutions, Build and Run](./reference/options-dialog-box-projects-and-solutions-build-and-run.md) and <xref:Microsoft.Build.Framework.LoggerVerbosity>.
82+
83+
## Use binary logs for large log files
6684

6785
:::moniker range="<=vs-2019"
86+
6887
Binary logs are an optional feature for .NET projects that lets you have a richer log browsing experience that might make it easier to find information in large logs. To use binary logs, install the [Project System Tools](https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.ProjectSystemTools). For more information, see [`https://msbuildlog.com`](https://msbuildlog.com) and [Binary Log](https://github.com/microsoft/msbuild/blob/master/documentation/wiki/Binary-Log.md).
88+
6989
:::moniker-end
7090
:::moniker range=">=vs-2022"
91+
7192
Binary logs are an optional feature for .NET projects that lets you have a richer log browsing experience that might make it easier to find information in large logs. To use binary logs, install the [Project System Tools 2022](https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.ProjectSystemTools2022). For more information, see [`https://msbuildlog.com`](https://msbuildlog.com) and [Binary Log](https://github.com/microsoft/msbuild/blob/master/documentation/wiki/Binary-Log.md).
93+
7294
:::moniker-end
7395

7496
## Related content
7597

76-
- [Build and clean projects and solutions in Visual Studio](../ide/building-and-cleaning-projects-and-solutions-in-visual-studio.md)
77-
- [Compile and build](../ide/compiling-and-building-in-visual-studio.md)
78-
- [Obtaining build logs with MSBuild](../msbuild/obtaining-build-logs-with-msbuild.md)
98+
- [Build and clean projects and solutions in Visual Studio](building-and-cleaning-projects-and-solutions-in-visual-studio.md)
99+
- [Compile and build](compiling-and-building-in-visual-studio.md)
100+
- [Obtain build logs with MSBuild](../msbuild/obtaining-build-logs-with-msbuild.md)

docs/msbuild/errors/msb3721.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ If you can't see the exact command-line that failed, you can change the verbosit
2626

2727
You can also set the `MSBuildDebugEngine` environment variable to 1 to get all possible logs. See [Building MSBuild for the .NET Framework - Logs](https://github.com/dotnet/msbuild/blob/main/documentation/wiki/Building-Testing-and-Debugging-on-Full-Framework-MSBuild.md#logs).
2828

29-
In Visual Studio, you can change the verbosity in **Tools** > **Options**, **Projects and Solutions**, **Build and Run**. See [How to: View, save, and configure build log files](../../ide/how-to-view-save-and-configure-build-log-files.md#to-change-the-amount-of-information-included-in-the-build-log).
29+
In Visual Studio, you can change the verbosity in **Tools** > **Options**, **Projects and Solutions**, **Build and Run**. See [How to: View, save, and configure build log files](../../ide/how-to-view-save-and-configure-build-log-files.md#specify-data-verbosity-for-build-logs).

0 commit comments

Comments
 (0)