Custom Serilog configuration

Component: Serilog Logger
NuGet Package NServiceBus.Serilog (4-pre)
This is a community run project
Target NServiceBus Version: 7.x
This page targets a pre-release version and is subject to change prior to the final release.

Illustrates customizing logging usage by configuring Serilog targets and rules.

Configure Serilog

Log.Logger = new LoggerConfiguration()
    .WriteTo.Console()
    .WriteTo.File(logFilePath)
    .CreateLogger();

Pass that configuration to NServiceBus

LogManager.Use<SerilogFactory>();

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

Related Articles

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

Last modified