-
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
Serilog not getting settings from appsettings.json in Net Core API 8 #415
Comments
i want to take the bug and work on it |
Hi! This doesn't look like a Serilog bug - it's probably better to post this one to Stack Overflow and work through all of the details around your setup. At first glance it looks like your JSON config is invalid - "Serillog" should be a root element and not under "Logging". HTH! |
Thanks! |
If you could make a PR that contains an example that would have helped you, that'd be a really great help for all concerned. "The obvious thing to show" is never as obvious when you wrote it and/or have used it lots of times and it just worked (either because somebody else rigged it or you copied from something that had it correct). |
I have generated PR #416 I hope this will help. |
Thank you! (I personally have never used the package, so someone more familiar with it will be along to review and/or merge it in due course) |
Thanks for your contribution @eleazarcelis. |
Description
ReadFrom.Configuration is not able to use configuration parameters from the appsettings.json file. It does not write the expected format on the console, it does not generate the expected log file.
this is my appsettings.json:
the appsettings class:
the main:
Reproduction
add nuget package:
dotnet add package Serilog (3.1.1)
dotnet add package Serilog.AspNetCore (8.0.1)
dotnet add package Serilog.Sinks.Console (5.0.1)
dotnet add package Serilog.Sinks.File (5.0.0)
Expected behavior
See the expected format on the console and the file in the expected folder
Relevant package, tooling and runtime versions
N/A
Additional context
Framework: Net Core 8
Project type: API
The text was updated successfully, but these errors were encountered: