Custom Serilog configuration

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


Illustrates customizing logging by configuring Serilog targets and rules.

Configure Serilog

Log.Logger = new LoggerConfiguration()

Pass that configuration to NServiceBus


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

Ensure logging is flushed on shutdown

await endpointInstance.Stop()

Related Articles

  • Logging
    Manage and integrate with NServiceBus logging.
  • Serilog Tracing
    Writing diagnostic log entries via Serilog Tracing.

Last modified