Reputation: 11427
When running a Rebus service bus, how would you set Rebus up to log to Application Insights?
Upvotes: 1
Views: 439
Reputation: 18628
One way would be to configure Rebus to use Serilog, and then use the Application Insights sink to pipe logs as trace or event telemetry.
Something like this:
// global Serilog config
Log.Logger = new LoggerConfiguration()
.WriteTo.ColoredConsole()
.WriteTo.ApplicationInsights(...) //< fill in instrumentation key etc here
.CreateLogger();
// configure Rebus
Configure.With(activator)
.Logging(l => l.Serilog())
.Transport(t => t.UseInMemoryTransport(new InMemNetwork(), "logging-test"))
.Start();
Upvotes: 1