A short post today; a colleague wanted to investigate a production issue when sending and receiving messages using MassTransit. He couldn’t find immediately how to change to capture more details about the MassTransit internals.
I had a look together with him. So for further reference you can find the answer here.
Using Serilog
On this specific project he was using Serilog so let me first show you how to change the log level for MassTransit when using Serilog:
Using Microsoft.Extensions.Logging
And here is the code changes required when using the default Microsoft.Extensions.Logging:
Remark: I would certainly recommend to have a look at the observability features of MassTransit as well and look to implement OpenTelemetry in your application.