Add support for sending NServiceBus logging message through Serilog
Plus into the standard NServiceBus logging API to pipe message through to Serilog.
This uses the standard approach to constructing a nuget package. It contains a dll which will be added as a reference to your project. You then deploy the binary with your project.
PM> Install-Package NServiceBus.Serilog
Log.Logger = new LoggerConfiguration()
.WriteTo.Console()
.WriteTo.File("logFile.txt")
.CreateLogger();
//Set NServiceBus to log to Serilog
LogManager.Use<SerilogFactory>();
Plugs into the low level NServiceBus pipeline to give more detailed diagnostics.
PM> Install-Package NServiceBus.Serilog.Tracing
Log.Logger = new LoggerConfiguration()
.WriteTo.Console()
.WriteTo.File("logFile.txt")
.MinimumLevel.Information()
.CreateLogger();
LogManager.Use<SerilogFactory>();
var config = new EndpointConfiguration("SeqSample");
config.EnableFeature<TracingLog>();
To log to Seq use
var tracingLog = new LoggerConfiguration()
.WriteTo.Seq("http://localhost:5341")
.MinimumLevel.Information()
.CreateLogger();
Then call
config.SerilogTracingTarget(tracingLog);
Which will result in something like this
Brain designed by Rémy Médard from The Noun Project