Errors log when running in Visual Studio but not under IIS

This is regarding uncaught exceptions from services (deeper below service, but initiated by service).

When we’re running our program (.NET 6) in Visual Studio, we get the full exception information in our log. The log level is ERR.

When the same code is published (we tried both Debug and Release), running under IIS (No Managed Code), the same exception is not logged. The log level on the logger is INF.

We’re using the Serilog and Serilog ServiceStack interface.

Any hints to what this could be?

There’s very little information to go off here, it’s not clear what the Exception is or what the actual differences are. But I don’t know why Exceptions would be logged differently under IIS, maybe try posting on StackOverflow to reach a broader audience. I’m assuming it’ll be differences in ASP .NET Core hosting model.

1 Like