Breaking Change: Revert the Console Formatter Default in .NET 6 #3706
mthalman
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In the .NET 6
aspnet
container images we made the decision to default the console logger inCreateDefaultBuilder()
to structured JSON logs in order to support container environments where folks use tools like fluentd or Azure Monitor to collect those logs. However, this resulted in non-human readable output that does not work well when viewing this output to analyze logs. Please see this issue for more details. We have made the decision to revert the default behavior back to multiline human-readable output.Servicing Update
In the May 2022 servicing update for .NET 6, we will change the
Logging__Console__FormatterName
environment variable to be unset for the ASP.NET Core container images. This will cause it to revert back to the original simple output.Output of original .NET 6 behavior with
Logging__Console__FormatterName
set toJson
:Output of the upcoming .NET 6 behavior with
Logging__Console__FormatterName
left unset:Breaking Change
Question: What do I do if this change breaks my system that relies on JSON formatting?
If you are currently using or want to use JSON, you will need to opt into this behavior since it will no longer be on by default. To do this please set the
Logging__Console__FormatterName
environment variable toJson
.Beta Was this translation helpful? Give feedback.
All reactions