-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Logging behavior doc #10859
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b4bee28
First draft of logging behaviour doc
maridematte 47a6ebb
Filled out missing info
maridematte acb25a0
PR comments
maridematte f932e52
More PR revisions
maridematte 76411a0
PR revisions once again
maridematte ba13457
Forgot to save before commiting changes
maridematte 25c80f9
behaviour -> behavior
maridematte File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
## Logging behaviour | ||
MSBuild has a few different built-in loggers, which have different behaviours depending on verbosity. For more information on loggers you can visit the [Microsoft Learn page](https://learn.microsoft.com/visualstudio/msbuild/obtaining-build-logs-with-msbuild), or take a look at the [high-level overview of MSBuild](https://github.com/dotnet/msbuild/blob/main/documentation/High-level-overview.md#diagnosability--loggers). | ||
|
||
If you are expecting to see a certain type of message (like test logs) but are unable to find it in one of our loggers, check if the verbosity is correct and if the message has the correct type and importance. | ||
|
||
### Message types | ||
There are various types of messages within MSBuild with different importances and purposes. | ||
There are some message types that are built-in within the engine, `errors`, `warnings`, and MSBuild engine information. The custom messages, that can come either from the engine or other sources, are selected and displayed based on the `importance` of the message. There can be high, normal, and low importance messages being displayed. More detail on which messages are displayed on individual loggers are on their respective sections. | ||
|
||
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) | ||
maridematte marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### Terminal logger | ||
Terminal logger is a new feature which improves the console experience. | ||
maridematte marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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`. | ||
|
||
To specify verbosity the `-verbosity` flag or `/tlp:verbosity={verbosity level}` | ||
|
||
| Verbosity | Quiet | Minimal | Normal | Detailed | Diagnostic | | ||
| --------- | ----- | ------- | ------ | -------- | ---------- | | ||
| Errors |✓| ✓ | ✓| ✓ | ✓ | | ||
| Warnings |✓| ✓ | ✓| ✓ | ✓ | | ||
| High-importance messages | | | | ✓ | ✓ | | ||
| Normal-importance messages | | ||
| Low-importance messages | | ||
| MSBuild engine information | | ||
maridematte marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### 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. | ||
maridematte marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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. | ||
maridematte marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
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 | ||
maridematte marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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. | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.