trenoncourt / serilog-enrichers-aspnetcore-httpcontext

Enriches Serilog events with Aspnetcore HttpContext.
MIT License
38 stars 17 forks source link

Only include at certain log levels #8

Open parkinsona opened 5 years ago

parkinsona commented 5 years ago

This extension is the best I've found so far for logging httpContext in .net core. I couldn't get the others to work correctly.

Is there a way to only include the httpContext at certain log levels? I'm concerned performance may be an issue if the properties are being added for every event level.

martinmani commented 5 years ago

may be you can configure your logger based on the log level? Or you can have a customMethod to take more control.