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

Mention MinimumLevel.Debug in README re #17 #18

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Then enable the sink using `WriteTo.Debug()`:
```csharp
Log.Logger = new LoggerConfiguration()
.WriteTo.Debug()
.MinimumLevel.Debug()
Copy link
Member

@bartelink bartelink Aug 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ?

.CreateLogger();

Log.Information("Hello, world!");
Expand All @@ -24,6 +25,10 @@ Log events will be printed to the debug output:

![Debug Output](https://raw.githubusercontent.com/serilog/serilog-sinks-debug/dev/assets/Screenshot.png)

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`.
Copy link
Member

@bartelink bartelink Aug 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 is Information. To output Debug (DBG in the above screenshot), the LoggerConfiguration must opt into the lower level, or the log message won't enter the output pipeline.


Note that if the chaining of this call is omitted, only events of `LogEventLevel.Information` and above will be logged.

### XML `<appSettings>` configuration

To use the sink with the [Serilog.Settings.AppSettings](https://github.com/serilog/serilog-settings-appsettings) package, first install that package if you haven't already done so:
Expand All @@ -47,6 +52,7 @@ In your application's `App.config` or `Web.config` file, specify the console sin
<appSettings>
<add key="serilog:using:Debug" value="Serilog.Sinks.Debug" />
<add key="serilog:write-to:Debug" />
<add key="serilog:minimum-level" value="Debug" />
```

### JSON `appsettings.json` configuration
Expand Down Expand Up @@ -74,7 +80,8 @@ In your `appsettings.json` file, under the `Serilog` node, :
```json
{
"Serilog": {
"WriteTo": ["Debug"]
"WriteTo": ["Debug"],
"MinimumLevel": "Debug"
}
}
```
Expand Down