-
Notifications
You must be signed in to change notification settings - Fork 67
Open
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<HttpContextAccessor>());
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?
Metadata
Metadata
Assignees
Labels
No labels