Custom Serilog configuration

Component: Serilog Logger
NuGet Package NServiceBus.Serilog (3.x)
This is a community maintained project
Target NServiceBus Version: 6.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

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

Last modified