You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/msbuild/obtaining-build-logs-with-msbuild.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Obtaining Build Logs with MSBuild
3
3
description: Use switches with MSBuild and specify how much build data to review and whether to save build data to one or more files.
4
-
ms.date: 07/15/2024
4
+
ms.date: 6/5/2025
5
5
ms.topic: how-to
6
6
helpviewer_keywords:
7
7
- MSBuild, logging
@@ -28,9 +28,9 @@ By using command-line options with MSBuild, you can specify how much build data
28
28
29
29
- A summary of the build.
30
30
31
-
By using the **-verbosity** (**-v**) switch, you can control how much data appears in the output log. For troubleshooting, use a verbosity level of either `detailed` (`d`) or `diagnostic` (`diag`), which provides the most information.
31
+
By using the `-verbosity` (`-v`) switch, you can control how much data appears in the output log. For troubleshooting, use a verbosity level of either `detailed` (`d`) or `diagnostic` (`diag`), which provides the most information.
32
32
33
-
The build process may be slower when you set the **-verbosity** to `detailed` and even slower when you set the **-verbosity** to `diagnostic`.
33
+
The build process may be slower when you set the `-verbosity` to `detailed` and even slower when you set the `-verbosity` to `diagnostic`.
34
34
35
35
```cmd
36
36
msbuild MyProject.proj -t:go -v:diag
@@ -51,13 +51,13 @@ The following table shows how the log verbosity (column values) affects which ty
51
51
52
52
## Save the build log to a file
53
53
54
-
You can use the **-fileLogger** (**fl**) switch to save build data to a file. The following example saves build data to a file that's named *msbuild.log*.
54
+
You can use the `-fileLogger` (`-fl`) switch to save build data to a file. The following example saves build data to a file that's named *msbuild.log*.
55
55
56
56
```cmd
57
57
msbuild MyProject.proj -t:go -fileLogger
58
58
```
59
59
60
-
In the following example, the log file is named *MyProjectOutput.log*, and the verbosity of the log output is set to `diagnostic`. You specify those two settings by using the **-fileLoggerParameters** (`flp`) switch.
60
+
In the following example, the log file is named *MyProjectOutput.log*, and the verbosity of the log output is set to `diagnostic`. You specify those two settings by using the `-fileLoggerParameters` (`-flp`) switch.
The following example saves the entire log to *msbuild1.log*, just the errors to *JustErrors.log*, and just the warnings to *JustWarnings.log*. The example uses file numbers for each of the three files. The file numbers are specified just after the **-fl** and **-flp** switches (for example, `-fl1` and `-flp1`).
70
+
The following example saves the entire log to *msbuild1.log*, just the errors to *JustErrors.log*, and just the warnings to *JustWarnings.log*. The example uses file numbers for each of the three files. The file numbers are specified just after the `-fl` and `-flp` switches (for example, `-fl1` and `-flp1`).
71
71
72
-
The **-fileLoggerParameters** (`flp`) switches for files 2 and 3 specify what to name each file and what to include in each file. No name is specified for file 1, so the default name of *msbuild1.log* is used.
72
+
The `-fileLoggerParameters` (`-flp`) switches for files 2 and 3 specify what to name each file and what to include in each file. No name is specified for file 1, so the default name of *msbuild1.log* is used.
@@ -79,7 +79,7 @@ If you're using a shell that interprets semicolons (for example, bash), put sing
79
79
80
80
## Save a binary log
81
81
82
-
You can save the log in compressed, binary format using the **-binaryLogger** (**bl**) switch. This log includes a detailed description of the build process and can be read by certain log analysis tools.
82
+
You can save the log in compressed, binary format using the `-binaryLogger` (`-bl`) switch. This log includes a detailed description of the build process and can be read by certain log analysis tools.
83
83
84
84
In the following example, a binary log file is created with the name *binarylogfilename*.
85
85
@@ -95,7 +95,7 @@ For more information, see [Command-line reference](../msbuild/msbuild-command-li
95
95
96
96
You can write your own logger by authoring a managed type that implements the <xref:Microsoft.Build.Framework.ILogger> interface. You might use a custom logger, for instance, to send build errors in email, log them to a database, or log them to an XML file. For more information, see [Build loggers](../msbuild/build-loggers.md).
97
97
98
-
In the MSBuild command line, you specify the custom logger by using the **-logger** switch. You can also use the **-noconsolelogger** switch to disable the default console logger.
98
+
In the MSBuild command line, you specify the custom logger by using the `-logger` switch. You can also use the `-noconsolelogger` switch to disable the default console logger.
0 commit comments