Mention MinimumLevel.Debug in README re #17#18
Mention MinimumLevel.Debug in README re #17#18Reeceeboii wants to merge 1 commit intoserilog:devfrom
Conversation
Added instructions for chaining debug level call. Also the same for the XML and JSON config.
| ```csharp | ||
| Log.Logger = new LoggerConfiguration() | ||
| .WriteTo.Debug() | ||
| .MinimumLevel.Debug() |
There was a problem hiding this comment.
have been looking at the serilog readme, and the MinimumLevel is not mentioned there either.
Space in there is at a premium, so even though it might trip quite a few people up, there's a very high bar for making the readme longer.
Also conflicted about whether I'd put this line here as it might suggest to people some linkage between this Sink being called Debug and the min level being Debug ?
|
|
||
|  | ||
|
|
||
| The chaining of the `MinimumLevel.Debug()` call is required in order to log events of level `LogEventLevel.Debug`, as the default minimum level for a new `LoggerConfiguration` is `LogEventLevel.Information`. |
There was a problem hiding this comment.
Perhaps instead of this, if we got a screenshot that did not include Debug output?
Or linked:
https://github.com/serilog/serilog/wiki/Configuration-Basics#minimum-level
with a message like
⚠️ The default minimum log level isInformation. To outputDebug(DBGin the above screenshot), theLoggerConfigurationmust opt into the lower level, or the log message won't enter the output pipeline.
|
Thanks @Reeceeboii - I added two notes on the PR. Your PR does the job, but on reflection, maybe the notice/example re the minimum level for a LoggerConfiguration belongs somewhere else (in Serilog Core?) I do agree that it's misleading and infuriating for the config in the readme not to be able to produce the output in the screenshot without any hint as to how to bridge the gap - that will definitely wind up resolved. I'm not sure what the overall view is - let's wait for others to review and we'll get there. |
|
Roger that. Will hang tight. This PR is open for maintainer changes so if I can't be reached in a timely manner and you have a way forward then I don't mind if others run this up 👍 |
|
I agree that the inclusion of What if we were to (at worst 😅) just edit the screenshot to show Ideally, I think the page https://github.com/serilog/serilog/wiki/Getting-Started, which we link prominently from the README, would carry some information about minimum level settings. |
|
I think part of the confusion from my end (that led to me raising #17 originally) was that I wanted to write I suppose my mind made the implicit link between the debug console sink and logs at a I do wonder if this is actually an issue worthy of a fix - if nobody else has raised this before, we could chalk it up to the way my brain was wired when attempting to integrate this sink. It was confusing me until I had mentally uncoupled the two separate uses of 'debug'. |
I have not actually used the sink myself (and I should) Sometimes I want to be able to up the Debug window trace level when Debugger.IsAttached I dont know if there are good patterns for that written up somewhere in a blog post I missed somewhere. I do think there is a case to answer, and this lib can be a place for a given right paragraph or two of examples or overviews to be housed as part of the overall offering. But handwaving that vs actually writing it well are very different things! |
Fixes #17.
Please let me know if you think anything needs adding or wording needs changing.