You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-1
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ Configuration is read from the `Serilog` section.
21
21
}
22
22
```
23
23
24
-
This example relies on the _Serilog.Sinks.Literate_, _Serilog.Sinks.File_, _Serilog.Enrichers.Environment_ and _Serilog.Sinks.Thread_ packages also being installed.
24
+
This example relies on the _Serilog.Sinks.Literate_, _Serilog.Sinks.File_, _Serilog.Enrichers.Environment_ and _Serilog.Enrichers.Thread_ packages also being installed.
25
25
26
26
After installing this package, use `ReadFrom.Configuration()` and pass an `IConfiguration` object.
27
27
@@ -64,3 +64,30 @@ To use this package in .NET 4.x applications, add `preserveCompilationContext` t
64
64
}
65
65
},
66
66
```
67
+
68
+
### Level overrides
69
+
70
+
The `MinimumLevel` configuration property can be set to a single value as in the sample above, or, levels can be overridden per logging source.
71
+
72
+
This is useful in ASP.NET Core applications, which will often specify minimum level as:
73
+
74
+
```json
75
+
"MinimumLevel": {
76
+
"Default": "Information",
77
+
"Override": {
78
+
"Microsoft": "Warning",
79
+
"System": "Warning"
80
+
}
81
+
}
82
+
```
83
+
84
+
### Environment variables
85
+
86
+
If your application enables the environment variable configuration source (`AddEnvironmentVariables()`) you can add or override Serilog configuration through the environment.
87
+
88
+
For example, to set the minimum log level using the _Windows_ command prompt:
0 commit comments