1
  "Serilog": {
    "Using": [ "Serilog.Sinks.RollingFile.Extension" ],
    "MinimumLevel": {
      "Default": "Warning",
      "Override": {
        "Microsoft": "Warning",
        "System": "Warning"
      }
    },
    "Enrich": [ "FromLogContext", "WithMachineName", "WithProcessId", "WithThreadId" ],
    "WriteTo": [
      {
        "Name": "File",
        "Args": {
          "rollingInterval": "Day",
          "fileSizeLimitBytes": 10485760,
          "pathFormat": "RDJOBS_{Date}_{Level}.json",
          "path": "c://logs",
          "formatter": "Serilog.Formatting.Json.JsonFormatter, Serilog"
        }
      },
      {
        "Name": "Seq",
        "Args": {
          "serverUrl": "http://localhost:5421"
        }
      }
    ]
  }
}

Problem – I want to create individual log files for tasks or classes (not base on the log event level) using serilog and respective configurations must do on appsetting.json file

SA_VL
  • 31
  • 4
  • 1
    With structured logging you don't this at all, you just query your log reader / diagnostic tool for your class, thread id, context. scope, trace, or what ever it is you are looking for – TheGeneral Sep 07 '21 at 08:03
  • Didn't you already get a response to this question here: https://stackoverflow.com/questions/69013614/how-to-create-individual-serilog-for-each-class-or-tasks-in-asp-net-core – juunas Sep 09 '21 at 06:52

0 Answers0