Skip to content

Instantly share code, notes, and snippets.

@hgmauri
Created November 7, 2023 10:37
Show Gist options
  • Save hgmauri/5075565ef3065560f19d566b5cae1cc8 to your computer and use it in GitHub Desktop.
Save hgmauri/5075565ef3065560f19d566b5cae1cc8 to your computer and use it in GitHub Desktop.
Log.Logger = new LoggerConfiguration()
.Enrich.FromLogContext()
.Enrich.WithExceptionDetails()
.Enrich.WithCorrelationId()
.Enrich.WithCorrelationIdHeader()
.WriteTo.Async(wt => wt.Console(outputTemplate: "[{Timestamp:HH:mm:ss} {Properties:j}{NewLine}{Exception}", restrictedToMinimumLevel: logLevel))
.CreateLogger();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment