Serilog Seq Logging

Component: Serilog Tracing | Nuget: NServiceBus.Serilog.Tracing (Version: 3.x)
This is a community run project
Target NServiceBus Version: 6.x

Prerequisites

An instance of Seq running one http://localhost:5341.

Code walk-through

Illustrates customizing logginNServiceBus.Serilog) usage by configuring Serilog targets and rules.

Configure Serilog

Edit
var tracingLog = new LoggerConfiguration()
    .WriteTo.Seq("http://localhost:5341")
    .MinimumLevel.Information()
    .CreateLogger();
var serilogFactory = LogManager.Use<SerilogFactory>();
serilogFactory.WithLogger(tracingLog);

Pass that configuration to NServiceBus

Edit
var endpointConfiguration = new EndpointConfiguration("Samples.Logging.SerilogTracing");
endpointConfiguration.EnableFeature<TracingLog>();
endpointConfiguration.SerilogTracingTarget(tracingLog);

Related Articles

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

Last modified