Skip to content
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

Documentation: Usage Instructions do not present the simplest way of setting up Serilog.AspNetCore #218

Open
r3use opened this issue Nov 11, 2020 · 3 comments

Comments

@r3use
Copy link

r3use commented Nov 11, 2020

Is your feature request related to a problem? Please describe.

Comming to Serilog and .Net Core I had to spend hours of trying to find out the simplest way of Setting up Serilog and having it read it's configuration from the settings file is:

.UseSerilog((hostingContext, services, loggerConfiguration) => loggerConfiguration .ReadFrom.Configuration(hostingContext.Configuration))

Describe the solution you'd like

This setup should be shown FIRST in the installation instructions. Together with the simplest configuration which writes to a log file and the console.

Also .UseSerilog() should use the settings file for configuration by default.

Additional context

I've seen multiple tutorials and guides setting up Serilog as described in the instrustions when all they had to do was call .UseSerilog as described above. You only really find it in the documentation by luck or if you already know how to do it.

@sungam3r
Copy link
Contributor

Also .UseSerilog() should use the settings file for configuration by default.

This will create internal dependencies between packages. I'm sure the authors wanted to avoid this.

@nblumhardt
Copy link
Member

Thanks for the pointer, @r3use ; the README is about to get a major overhaul now that we have https://nblumhardt.com/2020/10/bootstrap-logger/ coming down the pipe, so I'll give your comments some thought 👍

@r3use
Copy link
Author

r3use commented Nov 12, 2020

Also .UseSerilog() should use the settings file for configuration by default.

This will create internal dependencies between packages. I'm sure the authors wanted to avoid this.

I meant the hosting contexts configuration. I don't know if that that changes anything regarding dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants