You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
This example relies on theSerilog.Sinks.Literate,Serilog.Sinks.File,Serilog.Enrichers.Environment andSerilog.Sinks.Thread packages also being installed.
After installing this package, useReadFrom.Configuration() and pass anIConfiguration object.
TheWriteTo andEnrich sections support the same syntax, for example the following is valid if no arguments are needed by the sinks:
"WriteTo": ["LiterateConsole","DiagnosticTrace"]
Or alternatively, the long-form ("Name": ...) sytax from the first example can be used when arguments need to be supplied.
(This package implements a convention usingDependencyContext to find any package withSerilog anywhere in the name and pulls configuration methods from it, so theUsing example above is redundant.)
.NET 4.x
To use this package in .NET 4.x applications, addpreserveCompilationContext tobuildOptions inproject.json.