question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

EventSourceLogger always shows errors in output window

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
pakrymcommented, Oct 25, 2018

This seems to be a bug in how EventSource arguments get validated. Moving to 3.0.0 to track.

cc @muratg

0reactions
muratgcommented, Jan 8, 2019

Let’s close it. See dotnet/coreclr#20493

Read more comments on GitHub >

github_iconTop Results From Across the Web

WPF Binding Errors always show in the output window
I am working on a huge WPF project that has no binding errors. I usually track them down using Snoop, for more info...
Read more >
Logging in .NET Core and ASP.NET Core
Logs created with the default logging providers are displayed: In Visual Studio. In the Debug output window when debugging. In the ASP.
Read more >
The option "Always show Error List if build finishes with ...
When you right-click in the titlebar of the “Error List” window, ... If you turn that setting on, and always show the Output...
Read more >
Output window does not show output although no errors ...
so as the title explains when I run the program the output window popup the code start running but it remains black with...
Read more >
Setting up Serilog in ASP.NET Core 3
This means we'll still see warnings and errors from the framework, but not informational log events. Streamlined request logging. Our log output ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found