perfview: Bug in parsing logging events
I’m trying to use trace event to collect structured logs from a running process and I noticed that some data is being exposed from the wrong payload names.
As an example, here’s an MVC project that logs using ILogger:
HasStack="True",
ThreadID="18,028",
ProcessorNumber="0",
Level="2"
FactoryID="1"
LoggerName="Microsoft.AspNetCore.Hosting.Diagnostics"
EventId="1"
EventName="Request starting HTTP/1.1 GET http://localhost:7000/ "
FormattedMessage=""
HasStack="True"
ThreadID="18,028"
ProcessorNumber="0"
Level="2"
FactoryID="1"
LoggerName="Microsoft.AspNetCore.Routing.EndpointMiddleware"
EventId="0"
EventName="ExecutingEndpoint"
FormattedMessage="Executing endpoint '/Index'"
HasStack="True"
ThreadID="18,028"
ProcessorNumber="0"
Level="2"
FactoryID="1"
LoggerName="Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker"
EventId="3"
EventName="PageExecuting"
FormattedMessage="Route matched with {page = "/Index"}. Executing page /Index"
Notice that the first event has EventName as Request starting HTTP/1.1 GET http://localhost:7000/ and FormattedMessage as empty string. It seem as though there’s an issue when event name is null or empty then the formatted message becomes the event name. This also reproduces with other logging events so I’d imagine it’s the same bug.
Here’s the code that produces one of the events:
About this issue
- Original URL
- State: open
- Created 4 years ago
- Comments: 16 (11 by maintainers)
@davidfowl sorry I just got back from my 3-week vacation. I’ll look at this some time this week.