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
@@ -83,7 +83,7 @@ var logger = new LoggerConfiguration()
83
83
84
84
For .NET Core projects build tools produce `.deps.json` files and this package implements a convention using `Microsoft.Extensions.DependencyModel` to find any package among dependencies with `Serilog` anywhere in the name and pulls configuration methods from it, so the `Using` section in example above can be omitted:
85
85
86
-
```json
86
+
```yaml
87
87
{
88
88
"Serilog": {
89
89
"MinimumLevel": "Debug",
@@ -195,7 +195,7 @@ Or alternatively, the long-form (`"Name":` ...) syntax from the example above ca
195
195
196
196
By `Microsoft.Extensions.Configuration.Json` convention, array syntax implicitly defines index for each element in order to make unique paths for configuration keys. So the example above is equivalent to:
197
197
198
-
```json
198
+
```yaml
199
199
"WriteTo": {
200
200
"0": "Console",
201
201
"1": "DiagnosticTrace"
@@ -204,7 +204,7 @@ By `Microsoft.Extensions.Configuration.Json` convention, array syntax implicitly
204
204
205
205
And
206
206
207
-
```json
207
+
```yaml
208
208
"WriteTo:0": "Console",
209
209
"WriteTo:1": "DiagnosticTrace"
210
210
```
@@ -213,7 +213,7 @@ And
213
213
214
214
When overriding settings with [environment variables](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-3.1#environment-variables) it becomes less convenient and fragile, so you can specify custom names:
@@ -228,7 +228,7 @@ This section defines a static list of key-value pairs that will enrich log event
228
228
229
229
This section defines filters that will be applied to log events. It is especially usefull in combination with _[Serilog.Expressions](https://github.com/serilog/serilog-expressions)_ (or legacy _[Serilog.Filters.Expressions](https://github.com/serilog/serilog-filters-expressions)_) package so you can write expression in text form:
230
230
231
-
```json
231
+
```yaml
232
232
"Filter": [{
233
233
"Name": "ByIncludingOnly",
234
234
"Args": {
@@ -239,7 +239,7 @@ This section defines filters that will be applied to log events. It is especiall
239
239
240
240
Using this package you can also declare `LoggingFilterSwitch`-es in custom section and reference them for filter parameters:
@@ -260,7 +260,7 @@ Level updates to switches are also respected for a dynamic update.
260
260
261
261
Some Serilog packages require a reference to a logger configuration object. The sample program in this project illustrates this with the following entry configuring the _[Serilog.Sinks.Async](https://github.com/serilog/serilog-sinks-async)_ package to wrap the _[Serilog.Sinks.File](https://github.com/serilog/serilog-sinks-file)_ package. The `configure` parameter references the File sink configuration:
262
262
263
-
```json
263
+
```yaml
264
264
"WriteTo:Async": {
265
265
"Name": "Async",
266
266
"Args": {
@@ -286,7 +286,7 @@ When the configuration specifies a discrete value for a parameter (such as a str
286
286
287
287
Static member access can be used for passing to the configuration argument via [special](https://github.com/serilog/serilog-settings-configuration/blob/dev/test/Serilog.Settings.Configuration.Tests/StringArgumentValueTests.cs#L35) syntax:
288
288
289
-
```json
289
+
```yaml
290
290
{
291
291
"Args": {
292
292
"encoding": "System.Text.Encoding::UTF8",
@@ -299,7 +299,7 @@ Static member access can be used for passing to the configuration argument via [
299
299
300
300
If the parameter value is not a discrete value, it will try to find a best matching public constructor for the argument:
301
301
302
-
```json
302
+
```yaml
303
303
{
304
304
"Name": "Console",
305
305
"Args": {
@@ -317,7 +317,7 @@ For other cases the package will use the configuration binding system provided b
317
317
318
318
If parameter type is an interface or an abstract class you need to specify the full type name that implements abstract type. The implementation type should have parameterless constructor.
0 commit comments