Skip to content

Commit a5db777

Browse files
authored
Add Serilog setup configuration to docs.
1 parent 9aae04e commit a5db777

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

+22
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ The `AwsHttpConnection` class is an implemenation of `IConnection` that will sig
7777

7878
#### Serilog Sink Setup
7979

80+
In Code
8081
```csharp
8182
const string esUrl = "https://aws-es-thinger.us-west-1.es.amazonaws.com";
8283
Log.Logger = new LoggerConfiguration()
@@ -91,3 +92,24 @@ The `AwsHttpConnection` class is an implemenation of `IConnection` that will sig
9192
})
9293
.CreateLogger();
9394
```
95+
96+
In Configuration
97+
```json
98+
{
99+
"Serilog": {
100+
"Using": ["Serilog", "Serilog.Exceptions", "Serilog.Sinks.Elasticsearch", "Serilog.Enrichers.Environment", "Serilog.Enrichers.Process"],
101+
"MinimumLevel": "Debug",
102+
"WriteTo": [{
103+
"Name": "Elasticsearch",
104+
"Args": {
105+
"nodeUris": "https://******.us-east-1.es.amazonaws.com",
106+
"numberOfShards": 5,
107+
"numberOfReplicas": 10,
108+
"connection": "Elasticsearch.Net.Aws.AwsHttpConnection, Elasticsearch.Net.Aws"
109+
}
110+
}
111+
],
112+
"Enrich": ["FromLogContext", "WithMachineName", "WithExceptionDetails"],
113+
}
114+
}
115+
```

0 commit comments

Comments
 (0)