Closed chrissmithptml closed 2 years ago
For someone who needs this info. If you're building a .NET 5/6 Worker Host and are using the .UseNServiceBuseRouter syntax to configure your host, you can do the following to get the router to start logging to console etc.
Host.CreateDefaultBuilder(args)
.UseConsoleLifetime()
.ConfigureLogging(logging =>
{
logging.AddConsole();
logging.SetMinimumLevel(LogLevel.Information);
//Add the following lines
var nserviceBusLoggingFactory = NServiceBus.Logging.LogManager.Use<NServiceBus.Logging.DefaultFactory>();
nserviceBusLoggingFactory.Level(NServiceBus.Logging.LogLevel.Debug);
})
.UseNServiceBusRouter(ctx =>
{
Howdy, so I have 3 docker containers in my example:
Now, having followed every example under the sun and having proved that those examples do work locally, I am still unable to get the Router to route the Events from the Publisher to the Subscriber. Normal messages come through, but no events. I can see the Publisher is publishing the event AND sending the message, but the subscriber only ever gets the message, never the event.
I want to see what's going on with the Router. I want to see its debug output so I can see if the events are even reaching it and/or what's happening with them.
What's the trick to enabling debugging / verbose mode on the router, particularly using the .NET Core Worker Service UseNServiceBusRouter syntax?
Cheers in advance.