/Serilog.Sinks.ILogger

Serilog sink that writes to a Microsoft ILogger

Primary LanguageC#The UnlicenseUnlicense

Serilog.Sinks.ILogger

NuGet Version

Writes Serilog events to a Microsoft.Extensions.Logging.ILogger.

Getting started

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.

Optional parameters

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.