From cfbe437c4c1c44697c450b97ccf611198709a3a0 Mon Sep 17 00:00:00 2001 From: Reece Mercer Date: Sun, 18 Aug 2024 14:19:14 +0100 Subject: [PATCH] #17 README.md updates. Added instructions for chaining debug level call. Also the same for the XML and JSON config. --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 411d5e5..cce8520 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ Then enable the sink using `WriteTo.Debug()`: ```csharp Log.Logger = new LoggerConfiguration() .WriteTo.Debug() + .MinimumLevel.Debug() .CreateLogger(); Log.Information("Hello, world!"); @@ -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`. + +Note that if the chaining of this call is omitted, only events of `LogEventLevel.Information` and above will be logged. + ### XML `` 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: @@ -47,6 +52,7 @@ In your application's `App.config` or `Web.config` file, specify the console sin + ``` ### JSON `appsettings.json` configuration @@ -74,7 +80,8 @@ In your `appsettings.json` file, under the `Serilog` node, : ```json { "Serilog": { - "WriteTo": ["Debug"] + "WriteTo": ["Debug"], + "MinimumLevel": "Debug" } } ```