-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass-through of M.E.L.ILogger.BeginScope()
when using custom MEL ILoggingProvider
as Serilog sink?
#240
Comments
categoryName
when using .WriteTo.Providers()
ILogger.BeginScope()
when using custom MEL ILoggingProvider
as Serilog sink?
ILogger.BeginScope()
when using custom MEL ILoggingProvider
as Serilog sink?ILogger.BeginScope()
when using custom MEL ILoggingProvider
as Serilog sink?
ILogger.BeginScope()
when using custom MEL ILoggingProvider
as Serilog sink?M.E.L.ILogger.BeginScope()
when using custom MEL ILoggingProvider
as Serilog sink?
I'm running |
I've also tried adding the custom provider via conventional DI injection and then instructing Serilog to write to existing providers, using code like below:
Serilog doesn't let the custom logger see the |
If you're looking to solve this quickly, SO has way more people and is better suited to troubleshooting than GH issues - anyone that watches this repo watches the |
Ok thanks. Sorry for any notification spam. Looks like I can get the desired behavior by never calling
I'm not sure if the lack of pass-through of |
Don't worry about the notification spam; my main concern is stopping the frustration of logging stuff in the official Issues of a high traffic project to be met with crickets. I know SO can quite often feel like it just has a few more crickets for anything that's nontrivial. Main point is that issues in the Serilog repo necessarily are handled on a very async and intermittent basis, but it's a fact that anyone that's going to be useful in this will probably see it on SO first; whether or not they have time to answer it in the moment is a different matter. In other words, extending the problem discussion or logging research notes isn't a problem, and I'm not trying to chase you away; just set realistic expectations. |
Hi,
I'm trying to wire up "legacy" custom implementations of
Microsoft.Extensions.Logging.ILoggerProvider
andMicrosoft.Extensions.Logging.ILogger
as a Serilog sink.My Serilog configuration looks like this:
At runtime, my custom logger provider gets called and returns my custom
ILogger
implementations. So far so good.This particular logging provider needs some context provided via
ILogger.BeginScope()
to complete its logging.But, when I set breakpoints in my custom logger's implementations of
ILogger.Log(...)
andILogger.BeginScope(...)
methods, the breakpoint insideLog(...)
gets hit, but theBeginScope<TState>(...)
breakpoint never gets hit. The code being logged definitely calls_logger.BeginScope<TState>(foo)
with the state information that the custom logger needs. It looks like Serilog isn't passing theBeginScope<TState>()
information on to theCustomLogger
instances, so they never get a chance to capture the information they need to complete the logging.Am I using the APIs incorrectly or is this a bug?
The text was updated successfully, but these errors were encountered: