Where is `WithEcsHttpContext` defined and how to put this in `appsettings.json` `"Enrich"` configuration?
- Dominant language
- HTML
- Stars
- 137
- Forks
- 70
- PR merge metrics
- No merged PRs in 30d
Description
I am using `Elastic.CommonSchema.Serilog` `8.12.3` and get the following build error:
```
'LoggerEnrichmentConfiguration' does not contain a definition for 'WithEcsHttpContext' and no accessible extension method 'WithEcsHttpContext' accepting a first argument of type 'LoggerEnrichmentConfiguration' could be found (are you missing a using directive or an assembly reference?)
```
How to put the following
```
config.ReadFrom.Configuration(ctx.Configuration).Enrich.WithEcsHttpContext(ctx.Configuration.Get());
```
into `appsettings.json` `"Enrich"` configuration?
```
"Enrich": [
"FromLogContext",
"WithMachineName",
"WithThreadId"
],
```
Is the following `appsettings.json` still relevant with the latest development in ElasticSearch JSON formatter?
```
"WriteTo": [
{
"Name": "File",
"Args": {
"Args": {
"outputTemplate": "{Timestamp} {Level} {EventId} {Message:j} {Properties}{NewLine}{Exception}{NewLine}"
},
"Enrich": [
"FromLogContext"
],
"path": "/var/log/aspnetcore/log",
"rollingInterval": "Day",
"retainedFileCountLimit": 3,
"formatter": "Serilog.Formatting.Elasticsearch.ElasticsearchJsonFormatter, Serilog.Formatting.Elasticsearch, Version=0.0.0.0, Culture=neutral, PublicKeyToken=24c2f752a8e58a10"
}
}
]
```
If not, how should I change it to?
Contributor guide
Assessment
This issue has not been assessed yet.