Skip to content

Instantly share code, notes, and snippets.

@ddikman
Created February 1, 2016 10:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ddikman/1a60409697802876c161 to your computer and use it in GitHub Desktop.
Save ddikman/1a60409697802876c161 to your computer and use it in GitHub Desktop.
Example of a serilog configuration in json
{
"Logging": [
{
"key": "minimum-level",
"value": "Debug"
},
{
"key": "using:RollingFile",
"value": "Serilog.Sinks.RollingFile"
},
{
"key": "using:ColoredConsole",
"value": "Serilog.Sinks.ColoredConsole"
},{
"key": "using:RollingFile",
"value": "Serilog.Sinks.RollingFile"
},
{
"key": "using:ColoredConsole",
"value": "Serilog.Sinks.ColoredConsole"
},
{
"key": "write-to:RollingFile.pathFormat",
"value": "/var/log/mylog-{Date}.log"
},
{
"key": "write-to:RollingFile.retainedFileCountLimit",
"value": "15"
},
{
"key": "write-to:RollingFile.fileSizeLimitBytes",
"value": "1048576"
},
{
"key": "write-to:RollingFile.outputTemplate",
"value": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] [{HttpRequestTraceId}] {Message}{NewLine}{Exception}"
},
{
"key": "write-to:ColoredConsole.outputTemplate",
"value": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] [{HttpRequestTraceId}] {Message}{NewLine}{Exception}"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment