Custom Serilog configuration

Component: Serilog Logger
NuGet Package NServiceBus.Serilog (6.x)
This is a community maintained project
Target NServiceBus Version: 7.x

This sample illustrates how to customize logging by configuring Serilog targets and rules.

Configure Serilog

Log.Logger = new LoggerConfiguration()

Pass the configuration to NServiceBus


var endpointConfiguration = new EndpointConfiguration("Samples.Logging.SerilogCustom");

Ensure logging is flushed on shutdown

await endpointInstance.Stop()

Related Articles

Last modified