Skip to content

Commit 51736c1

Browse files
Merge pull request #13976 from MicrosoftDocs/ghogen-patch-422305
Review and update
2 parents 3f51c3e + ac3aab3 commit 51736c1

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

docs/msbuild/obtaining-build-logs-with-msbuild.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Obtaining Build Logs with MSBuild
33
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
55
ms.topic: how-to
66
helpviewer_keywords:
77
- MSBuild, logging
@@ -28,9 +28,9 @@ By using command-line options with MSBuild, you can specify how much build data
2828

2929
- A summary of the build.
3030

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.
3232

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`.
3434

3535
```cmd
3636
msbuild MyProject.proj -t:go -v:diag
@@ -51,13 +51,13 @@ The following table shows how the log verbosity (column values) affects which ty
5151

5252
## Save the build log to a file
5353

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*.
5555

5656
```cmd
5757
msbuild MyProject.proj -t:go -fileLogger
5858
```
5959

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.
6161

6262
```cmd
6363
msbuild MyProject.proj -t:go -fl -flp:logfile=MyProjectOutput.log;verbosity=diagnostic
@@ -67,9 +67,9 @@ msbuild MyProject.proj -t:go -fl -flp:logfile=MyProjectOutput.log;verbosity=diag
6767

6868
## Save the log output to multiple files
6969

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`).
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`).
7171

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.
7373

7474
```cmd
7575
msbuild MyProject.proj -t:go -fl1 -fl2 -fl3 -flp2:logfile=JustErrors.log;errorsonly -flp3:logfile=JustWarnings.log;warningsonly
@@ -79,7 +79,7 @@ If you're using a shell that interprets semicolons (for example, bash), put sing
7979

8080
## Save a binary log
8181

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.
8383

8484
In the following example, a binary log file is created with the name *binarylogfilename*.
8585

@@ -95,7 +95,7 @@ For more information, see [Command-line reference](../msbuild/msbuild-command-li
9595

9696
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).
9797

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.
9999

100100
## Related content
101101

0 commit comments

Comments
 (0)