You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
We have microservices that have milions of requests per minute, however we do every 5 minutes some end-2-end monitorings. Because of the ammount of logs we would generate we cannot afford to have verbosity lower than Warning. However these monitorings tend to fail from time to time, and these monitorings have some special header that when we process a request we know its from monitoring. For such request issued by monitoring it would be helfpul to have a diferent log level for example Information. Otherwise I have to create a new logger with a specific category based on if this is monitoring
Describe the solution you'd like
Some ability to modify the log level for some scope
Describe alternatives you've considered
Initialize a logger with diferent category
The text was updated successfully, but these errors were encountered:
When you set up Serilog, you'll somewhere be doing an AddSerilog() or UseSerilog() call to wire it into MEL, and/or setting Log.Logger to an ILogger instance.
You may be able to get what you're after by wrapping this root logger in your own custom type, which would need to implement ILogger, IDisposable, and IAsyncDisposable.
All methods would forward to the wrapped logger, except IsEnabled(LogEventLevel), which would perform some custom check based on an AsyncLocal, and ForContext(), which would use the same logic as IsEnabled() to detect that the current request/activity/whatever is a sampled one, and in those cases, wrap the results of calling ForContext() on the inner logger in an additional instance of your wrapper type before returning the result.
Is your feature request related to a problem? Please describe.
We have microservices that have milions of requests per minute, however we do every 5 minutes some end-2-end monitorings. Because of the ammount of logs we would generate we cannot afford to have verbosity lower than Warning. However these monitorings tend to fail from time to time, and these monitorings have some special header that when we process a request we know its from monitoring. For such request issued by monitoring it would be helfpul to have a diferent log level for example Information. Otherwise I have to create a new logger with a specific category based on if this is monitoring
Describe the solution you'd like
Some ability to modify the log level for some scope
Describe alternatives you've considered
Initialize a logger with diferent category
The text was updated successfully, but these errors were encountered: