Custom Serilog configuration

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

Introduction

Illustrates customizing logging by configuring Serilog targets and rules.

Configure Serilog

Log.Logger = new LoggerConfiguration()
    .WriteTo.Console()
    .WriteTo.File("logFile.txt")
    .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