Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can't I see my Console logs from Serilog?

I am new to Serilog and I was able to log to a file, but I can't seem to see my logs in console.

In my console this is what I see:

https://gyazo.com/7bf1dbf4eef0ed334576a170f6f73f0f

Here is my settings for Serilog

{
  "Serilog": {
    "Using": [
      "Serilog.Sinks.Console"
    ],
    "WriteTo": [
      {
        "Name": "Async",
        "Args": {
          "configure": [
            {
              "Name": "File",
              "Args": {
                "path": "log-.txt",
                "rollingInterval": "Day",
                "outputTemplate": "{Timestamp:o} [{Level:u3}] ({Application}/{MachineName}/{ThreadId}) {Message}{NewLine}{Exception}"
              }
            },
            {
              "Name": "Console"
            }
          ]
        }
      }
    ]
  }
}

like image 371
Jade Avatar asked Sep 18 '25 13:09

Jade


1 Answers

The documentation of the Serilog.Console sink (screenshot below) has all the settings you need to configure.

It also looks like you are confusing Console output with Debug output. If you want to write to the Debug output, then you need to use Serilog's Debug Sink instead.


Serilog Settings

like image 144
C. Augusto Proiete Avatar answered Sep 21 '25 22:09

C. Augusto Proiete