Skip to content
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

log output isn't colored on .NET SDK (5.0.100) #106

Closed
nilobarp opened this issue Dec 3, 2020 · 1 comment
Closed

log output isn't colored on .NET SDK (5.0.100) #106

nilobarp opened this issue Dec 3, 2020 · 1 comment

Comments

@nilobarp
Copy link

nilobarp commented Dec 3, 2020

After upgrading to .NET 5 serilog console output colors stopped working. The following configuration works fine on 3.1.

"Serilog": {
    "MinimumLevel": {
      "Default": "Debug",
      "Override": {
        "Microsoft.EntityFrameworkCore.Database.Command": "Warning",
        "Microsoft.EntityFrameworkCore": "Warning",
        "Microsoft.Hosting.Lifetime": "Information",
        "Microsoft.AspNetCore.Hosting.Diagnostics": "Warning",
        "Microsoft.AspNetCore": "Warning",
        "Microsoft": "Warning",
        "System": "Warning"
      }
    },
    "Using": ["Serilog.Sinks.Console"],
    "WriteTo": [
      {
        "Name": "Console",
        "Args": {
          "theme": "Serilog.Sinks.SystemConsole.Themes.AnsiConsoleTheme::Code, Serilog.Sinks.Console",
          "outputTemplate": "{Timestamp:dd-mm-yy HH:mm:ss} {Level:u3} {Message:lj} {Properties}{NewLine}{Exception}"
        }
      }
    ]
  }
@jmalatia
Copy link

I had the same issue... fixed it by changing my launchSettings.json removing the entry launchBrowser and after making this change, console colors returned.

See serilog/serilog-aspnetcore#229 (comment) with link to dotnet/aspnetcore#25317

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants