-
Notifications
You must be signed in to change notification settings - Fork 129
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
.NET Framework: Configuring Enrichers from json does not work #122
Comments
@aFuerst are you missing a using in the settings for `Serilog.Enrichers.Environment?
|
@merbla That was it. Thank you! |
Actually the README says :
So we are actually saying that Lines 297 to 302 in 74fb413
So there is either a bug or an incorrect documentation issue here :) |
Is there a test for that? Sounds like we need one if not. |
The sample app does not specify |
We are experiencing the same issue adding serilog to a 4.6.1 web project via ninject. The library is not loading enrichers nor sinks (File and Seq).
It only works as soon as we add all namespaces (enrichers and sinks) to the "Using" property. This could be an issue with the framework version, because the same json configuration works properly on our .net core projects. |
Ah, yes, the "Using" blocks are only redundant in Core, IIRC the dependency context works differently on Framework :-/ |
fixed by #159 |
I'm experiencing this same issue. I'm using Core 3.1, though, so maybe something is broken in a different way than was previous fixed. My config file has these lines that seem relevant:
The rest of my configuration seems to work, so I'm not sure what else I might check. I don't notice any error messages or exceptions ... |
Hi, @mikeblas . Just checked with 3.1 - works as expected. Can you provide your setup or minimal code that reproduce this? Thanks! |
Does this issue relate to a new feature or an existing bug?
What version of Serilog is affected? Please list the related NuGet package.
Serilog, Version=2.0.0.0
Serilog.Enrichers.Process, Version=2.0.0.0
Serilog.Enrichers.Thread, Version=2.0.0.0
Serilog.Enrichers.Environment, Version=2.0.0.0
Serilog.Settings.Configuration, Version=2.6.1.0
What is the target framework and operating system? See target frameworks & net standard matrix.
Please describe the current behavior?
Enrichers configured via json configuration are not applied.
The created logger has an empty enricher.
Please describe the expected behavior?
The enrichers specified in the json config should be applied to the created logger and the data they are supposed to add gets put in the logs
If the current behavior is a bug, please provide the steps to reproduce the issue and if possible a minimal demo of the problem
This is the config section I have
We're using the full .NET Framework.
The logger creation looks like this. We load it entirely from the IConfiguration object.
The text was updated successfully, but these errors were encountered: