Skip to content

Commit

Permalink
Add Serilog setup configuration to docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
bcuff authored May 27, 2020
1 parent 9aae04e commit a5db777
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ The `AwsHttpConnection` class is an implemenation of `IConnection` that will sig

#### Serilog Sink Setup

In Code
```csharp
const string esUrl = "https://aws-es-thinger.us-west-1.es.amazonaws.com";
Log.Logger = new LoggerConfiguration()
Expand All @@ -91,3 +92,24 @@ The `AwsHttpConnection` class is an implemenation of `IConnection` that will sig
})
.CreateLogger();
```

In Configuration
```json
{
"Serilog": {
"Using": ["Serilog", "Serilog.Exceptions", "Serilog.Sinks.Elasticsearch", "Serilog.Enrichers.Environment", "Serilog.Enrichers.Process"],
"MinimumLevel": "Debug",
"WriteTo": [{
"Name": "Elasticsearch",
"Args": {
"nodeUris": "https://******.us-east-1.es.amazonaws.com",
"numberOfShards": 5,
"numberOfReplicas": 10,
"connection": "Elasticsearch.Net.Aws.AwsHttpConnection, Elasticsearch.Net.Aws"
}
}
],
"Enrich": ["FromLogContext", "WithMachineName", "WithExceptionDetails"],
}
}
```

0 comments on commit a5db777

Please sign in to comment.