Available configuration options

{
    "Serilog": {
      "Using": [],
      "MinimumLevel": "",
      "WriteTo": [
          { 
            "Name": "",
            "Args": { "": "" }
          }
      ]
      "Enrich": [],
      "Destructure": [],
      "Properties": {
      }
    }
}

See

Using

Sink names as array

{
    "Serilog": {
      "Using": ["Serilog.Sinks.Console", "Serilog.Sinks.File", "Serilog.Sinks.Async", "Serilog.Sinks.Seq"],
    }
}

Notes

MinimumLevel

Default Level: Information

{
  "Serilog": {
    "MinimumLevel": {
      "Default": "Debug",
      "Override": {
        "Microsoft": "Debug",
        "System": "Debug"
      }
    },
  }
}

See:

Overriding MinimumLevel Per Sink

Log.Logger = new LoggerConfiguration()
    .MinimumLevel.Debug()
    .WriteTo.File("log.txt")
    .WriteTo.Console(restrictedToMinimumLevel: LogEventLevel.Information)
    .CreateLogger();

Output template

appsettings.json

{
    "Serilog": {

      "WriteTo": [
        { 
            "Name": "sink_name",
            "Args": {
              "outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj} <s:{SourceContext}>{NewLine}{Exception}",
            }
        },
      ]
    }
}