Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Signed-off-by: David Fowler <davidfowl@gmail.com>
  • Loading branch information
davidfowl authored May 14, 2023
1 parent 6090f8d commit e386445
Showing 1 changed file with 0 additions and 47 deletions.
47 changes: 0 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,50 +209,3 @@ docker run -d --name jaeger -e COLLECTOR_ZIPKIN_HOST_PORT=:9411 -e COLLECTOR_OTL

1. Open [Jaeger in your browser](http://localhost:16686/)
1. View the collected spans

### Logs

This app using `structured logging` and for this purpose we use [Serilog](https://github.com/serilog/serilog-aspnetcore)

For setting up Serilog you should call `AddSerilog` on [SerilogExtensions](TodoApi/Extensions/SerilogExtensions.cs) class and Add `Serilog` section with appropriate [Options](TodoApi/Extensions/SerilogExtensions.cs#L95)

```json
"Serilog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
}
}
```

For collecting and searching logs there are 2 `optional` way, based on `your needs` in the production environment:
- Seq (Not Free in commercial use)
- Elasticsearch and Kibana (Free)

#### Seq
For using seq, we should enable it with setting `SeqUrl` value in the `Serilog` section of [appsettings.json](TodoApi/appsettings.json):

``` json
"Serilog": {
...
"SeqUrl": "http://localhost:5341",
...
},
```
Also we should run [seq server](docker-compose.yml#47) on docker-compose file, now seq is available on [http://localhost:8081](http://localhost:8081) and we can see logs out there.

#### Elasticsearch and Kibana
For using elasticsearch and kibana, we should enable it with setting `ElasticSearchUrl` value in the `Serilog` section of [appsettings.json](TodoApi/appsettings.json):

```json
"Serilog": {
...
"ElasticSearchUrl": "http://localhost:9200",
...
}
```
Also we should run [Elasticsearch](docker-compose.yml#84) and [Kibana](docker-compose.yml#104) on docker-compose file, now we can see our logs on kibana url [http://localhost:5601](http://localhost:5601) and
index name `todoapi`.

0 comments on commit e386445

Please sign in to comment.