We are hosting our ASP.NET Core services in Google Cloud, and the logs from Stack Driver always use ANSI/VT100 color codes, like this:
[40m[32minfo[39m[22m[49m
Is there a way to tell the ASP.NET default logger to not use those codes?
(P.S.: I know we should move to structured logging, that's next)
based on the github issue,
set ASPNETCORE_LOGGING__CONSOLE__DISABLECOLORS
env to true
or add this to your appsettings.json
:
"Logging": {
"Console": {
"DisableColors": true
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With