-
Notifications
You must be signed in to change notification settings - Fork 345
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
Logging - Improve the Documentation #983
Comments
Hummm... Now I'm confused again... Has the .Net logging API been replaced with the serilog library since version 3.1.3-ci20210907103? |
@thecliguy, the more recent CI builds have serilog logging, but the official release (at time 3.1.3.2) is using net logging. The interesting challenge here is maintaining the documentation for both versions. Out of the box, the logging should be essentially on par with the prior logging solution. Perhaps adding to document to describe both with a version note attached to avoid confusion. If you are looking at extended loggers to different sinks etc, then I think some documentation on how to do that would be beneficial. Details of configuring serilog via the appsettings.json can be found here https://github.com/serilog/serilog-settings-configuration |
@jafin In the recent CI builds, can you choose whether to use the .Net logging API or the serilog library? Or has serilog completely replaced the .Net logging API? |
@thecliguy net logging has been replaced with serilog logging in the CI build. |
I tried to debug smt4dev with logging, but I don't get any debug logs from SmtpServer.cs (for example from the private async Task Core() method) into the console. I've been trying for two days to figure out why Microsoft.Extensions.Logging doesn't use Serilog in this case, but without success. Can any of you think of a reason why? I have in appsettings: "Serilog": {
"Using": [ "Serilog", "Serilog.Sinks.Console" ],
"MinimumLevel": {
"Default": "Debug",
"Override": {
// For detailed diagnostics set to Information
"Microsoft": "Warning",
"Microsoft.EntityFrameworkCore": "Warning"
}
},
"WriteTo": [
{
"Name": "Console",
"args": {
"outputTemplate": "{Message:lj}{NewLine}{Exception}"
}
}
],
"Properties": {
"ApplicationName": "Smtp4Dev"
}
}, |
The Configuration page on the wiki shows an example config file where logging is implemented as follows:
At first it wasn't obvious to me how these settings worked...
Having now done some further research I believe that logging is implemented using the .Net logging API and Microsoft have done a pretty nice job at documenting it
Obviously it's not worth writing lots of documentation when Microsoft have done that work already - but it would have saved me a lot of time if the Configuration page included a sentence or two explaining how logging is implemented with a link to Microsoft's documentation.
The text was updated successfully, but these errors were encountered: