You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I couldn't use UseSerilog() in my application for reasons delved into here (my application is complex using autofac and child containers, and my own library for multitenancy) - and my workaround was to do this instead:
webhostBuilder.ConfigureLogging((logging) =>
{
logging.ClearProviders();// clears microsoft providers registered by default like console.
logging.AddSerilog(Logger);
});
Which works. I raise this here because I thought maybe you could simplify the UseSerilog() implementation to call this method on the host builder instead, and then you could ditch your custom ILoggerFactory ?
The text was updated successfully, but these errors were encountered:
Thanks for the note! The workaround you're using is the supported one, here; we deliberately use our own ILoggerFactory to avoid inconsistencies/edge cases around filtering and configuration, but the Serilog provider works when the default approach isn't viable 👍
Hello it's me again!
I couldn't use
UseSerilog()
in my application for reasons delved into here (my application is complex using autofac and child containers, and my own library for multitenancy) - and my workaround was to do this instead:Which works. I raise this here because I thought maybe you could simplify the UseSerilog() implementation to call this method on the host builder instead, and then you could ditch your custom ILoggerFactory ?
The text was updated successfully, but these errors were encountered: