Serilog Tracing

Project Hosting
NuGet Package NServiceBus.Serilog.Tracing (4.x) | License
This is a community run project. License and support are independent of Particular Software.
Target NServiceBus Version: 7.x

Writing diagnostic log entries to Serilog. Plugs into the low level pipeline to give more detailed diagnostics.

Usage

It is optional to use Serilog as the main NServiceBus logger. i.e. no need to include LogManager.Use<SerilogFactory>();.

Create an instance of a Serilog Logger

var tracingLog = new LoggerConfiguration()
    .WriteTo.ColoredConsole()
    .MinimumLevel.Information()
    .CreateLogger();

Configure the Tracing feature to use that logger

var busConfiguration = new EndpointConfiguration("EndpointName");
busConfiguration.EnableFeature<TracingLog>();
busConfiguration.SerilogTracingTarget(tracingLog);

Seq

To log to Seq:

var tracingLog = new LoggerConfiguration()
    .WriteTo.Seq("http://localhost:5341")
    .MinimumLevel.Information()
    .CreateLogger();

Samples

Related Articles

  • Logging
    Manage and integrate with NServiceBus logging.
  • Serilog
    Logging to Serilog.

Last modified