-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log Output Does Not Work for Application Paths When Using ParallelApplicationPipelinesExtensions #190
Comments
Note that I also tested this on ASP.NET Core 3.0 and it still doesn't work. |
Ok, I figured out a fix for my scenario, but it applies to asp.net core 3.0. I haven't investigated a asp.net core 2* fix. Here's the change to make in https://github.com/WebApiContrib/WebAPIContrib.Core/blob/master/src/WebApiContrib.Core/ParallelApplicationPipelinesExtensions.cs - var webHost = new WebHostBuilder().
+ var webHost = Host.CreateDefaultBuilder().
ConfigureServices(s => {
s.AddSingleton<IServer, DummyServer>();
}).
ConfigureServices(servicesConfiguration).
- UseStartup<EmptyStartup>().
+ ConfigureWebHostDefaults(wh => wh.UseStartup<EmptyStartup>()).
Build();
var serviceProvider = webHost.Services;
- var serverFeatures = webHost.Features;
+ var serverFeatures = new FeatureCollection(); This sets up logging correctly. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using
ParallelApplicationPipelinesExtensions
, log messages originating from an application path do not show in the console.Repro Steps
WelcomeService.cs
dotnet run
from the console.Expected Behavior
I expect to see the "Error Will Robinson" message in the console output.
Actual Behavior
I only see log messages from ASP.NET Core itself.
Extra Information
Note that if you change the
Main
method inProgram.cs
like so...That log message works. It seems to me that the logging services or configuration are not carried over to the application paths.
/cc @filipw
The text was updated successfully, but these errors were encountered: