Writes Serilog events to a Microsoft.Extensions.Logging.ILogger
.
Install the Serilog.Sinks.ILogger package from NuGet:
Install-Package Serilog.Sinks.ILogger
To configure the sink in C# code, call WriteTo.ILogger()
during logger configuration:
var log = new LoggerConfiguration()
.WriteTo.ILogger(logger)
.CreateLogger();
logger The ILogger
.
outputTemplate A message template describing the output messages. See https://github.com/serilog/serilog/wiki/Formatting-Output.
restrictedToMinimumLevel The minimum level for events passed through the sink.