Broken app startup when Overriding Microsoft logs
See original GitHub issueI have a strange behaviour when I start a new Asp .Net Core project in VS2019, with Docker support on Linux. I add the support of docker-compose, and update the default program.cs with the one in the EarlyInitializationSample. (With Serilog.AspNetCore 3.0 nuget package) I start the app, everything works fine, it launches my browser on the WeatherForecastController (the demo controller from the Visual Studio template).
If I add a filter in the logger configuration (.MinimumLevel.Override("System", LogEventLevel.Warning)
), it still works as expected.
BUT ! If I replace System
by Microsoft
(.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
), the application start, but seems to stop loading stuff in the middle of the startup process, and it doesn’t launch my browser.
My app seems to respond normally, but I fear it could hide something wierd…
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (3 by maintainers)
I’ve encountered the same issue, and after reading this thread and your comment in particular I made some testing with the logging output.
It seems indeed that VS is waiting on a specific output from
Microsoft.Hosting.Lifetime
to launch the browser.Those are the first log outputs from that Namespace that appear in the logs and if I silence them (change the log level to something higher than
Information
) the browser won’t launch.There is no issue what so ever with Serilog.
Indeed, it could just be a VS issue as it’s the only visible problem… But it works with .Net Core 2.2, so I’ll try with the next release of .Net Core 3 !