Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ChuckBryan/00121ad372eb2e7a20569200f98fb87f to your computer and use it in GitHub Desktop.
Save ChuckBryan/00121ad372eb2e7a20569200f98fb87f to your computer and use it in GitHub Desktop.
Serilog Configuration
<PackageReference Include="Serilog.Enrichers.Environment" Version="2.2.0" />
<PackageReference Include="Serilog.Enrichers.Process" Version="2.0.2" />
<PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="5.0.1" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.4.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" />
"Serilog": {
"MinimumLevel": {
"Default": "Debug",
"Override": {
"Microsoft": "Warning",
"System": "Warning"
}
},
"Enrich": [
"FromLogContext",
"WithMachineName",
"WithProcessId",
"WithThreadId"
],
"WriteTo": [
{
"Name": "Console",
"Args": {
"outputTemplate": "{Timestamp:yyyy-MM-ddTHH:mm:ss.fffzzzz} [{Level:u3}] ({MachineName}@{ProcessId}.{ThreadId}-{SourceContext}) {Message:lj}{NewLine}{Exception}"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment