Skip to content

Logging behavior doc #10859

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Dec 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions documentation/Logging-behaviour.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,6 @@ There are some message types that are built-in within the engine, `errors`, `war

For more information on custom messages you can more ou Microsoft Learn page for the [MSBuild Message Task](https://learn.microsoft.com/visualstudio/msbuild/message-task)

### Console logger
Console logger refers to the logger that outputs to the console in VS or the terminal that is being used. It is not the default logger after the [.NET 9 update](https://learn.microsoft.com/en-us/dotnet/core/compatibility/sdk/9.0/terminal-logger) but still can be accessed by opting out of the Terminal Logger feature.

The console logger defaults to normal verbosity, and can be overriden by passing the `-verbosity` attribute, or passing the `verbosity` property to the console logger `clp:verbosity={verbosity level}`.

| Verbosity | Quiet | Minimal | Normal | Detailed | Diagnostic |
| --------- | ----- | ------- | ------ | -------- | ---------- |
| Errors |✓| ✓ | ✓| ✓ | ✓ |
| Warnings |✓| ✓ | ✓| ✓ | ✓ |
| High-importance messages | | ✓ | ✓| ✓ | ✓ |
| Normal-importance messages | | | ✓| ✓ | ✓ |
| Low-importance messages | | | | ✓ | ✓ |
| MSBuild engine information | | | | | |

### Terminal logger
Terminal logger is a new feature which improves the console experience.
For more information on how the terminal logger behaves see the [dotnet build options](https://learn.microsoft.com/dotnet/core/tools/dotnet-build#options) under `-tl`.
Expand All @@ -38,9 +24,24 @@ To specify verbosity the `-verbosity` flag or `/tlp:verbosity={verbosity level}`
| Low-importance messages |
| MSBuild engine information |

### Binary logger / build logger
The binary logger does not have a verbosity option. It includes all messages, projects and files from the build by default.
You can find more information about the binlogs on [MSBuild Github Documentation](https://github.com/dotnet/msbuild/blob/main/documentation/wiki/Binary-Log.md).

### Console logger
Console logger refers to the logger that outputs to the console in VS or the terminal that is being used. It is not the default logger after the [.NET 9 update](https://learn.microsoft.com/en-us/dotnet/core/compatibility/sdk/9.0/terminal-logger) but still can be accessed by opting out of the Terminal Logger feature.

The console logger defaults to normal verbosity, and can be overriden by passing the `-verbosity` attribute, or passing the `verbosity` property to the console logger `clp:verbosity={verbosity level}`.

| Verbosity | Quiet | Minimal | Normal | Detailed | Diagnostic |
| --------- | ----- | ------- | ------ | -------- | ---------- |
| Errors |✓| ✓ | ✓| ✓ | ✓ |
| Warnings |✓| ✓ | ✓| ✓ | ✓ |
| High-importance messages | | ✓ | ✓| ✓ | ✓ |
| Normal-importance messages | | | ✓| ✓ | ✓ |
| Low-importance messages | | | | ✓ | ✓ |
| MSBuild engine information | | | | | |

### File logger
The File logger saves all the build data to a file. It's verbosity is determined by passing the `verbosity` parameter to the `flp` attribute, or the default is set to `diagnostic`, and it follows the same message display rules as the console logger.

### Binary logger / build logger
The binary logger is a bit different as it does not have a verbosity option. It includes all messages, projects and files from the build by default.
You can find more information about the binlogs on [MSBuild Github Documentation](https://github.com/dotnet/msbuild/blob/main/documentation/wiki/Binary-Log.md).
Loading