-
Notifications
You must be signed in to change notification settings - Fork 132
Description
When using a web host subloggers don't seem to work.
I've created a very stripped down version of what we're doing and uploaded that as a reference repo in the hopes that you might point out what I'm doing wrong, or figure out why it's failing.
As you can see I have a web host and a console host. They both use the same logging configuration, yet the sublogger only work for the console host. The interresting bit is that the straight file logger works for both hosts, so it's not that serilog is not working at all, it's just that the subloggers aren't working.
I've also included an alternate configuration option for configuring through code instead of through settings. Swap between SerilogConfig.RegisterBySettings and SerilogConfig.RegisterByCode to see how using SerilogConfig.RegisterByCode causes the sublogger to work in both hosts.
Note: We're in a bit of a crossover between older and newer tech which might be a reason why this does not work, though I don't see why it would cause an issue seing as it works for SerilogConfig.RegisterByCode.