Skip to content

EventSourceLogger always shows errors in output window #651

@kwaclaw

Description

@kwaclaw

I created a basic Asp.NetCore 2.1 web application from the VS 2017 template and configured logging like this:

        public static IWebHostBuilder CreateWebHostBuilder(string[] args) {
            return WebHost.CreateDefaultBuilder(args)
                .UseStartup<Startup>()
                .ConfigureLogging((ctx, lb) => {
                    lb.AddEventSourceLogger();
                });
        }

Whenever the events from the Microsoft-Extensions-Logging provider are consumed each log entry gets reported like this example in the output window:

Microsoft.AspNetCore.Hosting.Internal.WebHost:Information: Request starting HTTP/1.1 GET http://localhost:44321/Contact  
The parameters to the Event method do not match the parameters to the WriteEvent method. This may cause the event to be displayed incorrectly.

This happens when using PerView, the Diagnostic Events viewer window in VS 2017, or when using Microsoft.Diagnostics.EventFlow.

I can still get the events, but I wonder if they are incomplete. For instance, in the example above, the request path "http://localhost:44321/Contact" is not included in the log entry. However, I would expect it to be logged.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions