You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ECS integration/library project(s) (e.g. Elastic.CommonSchema.Serilog): Elastic.Serilog.Sinks ECS schema version (e.g. 1.4.0): The last one (v8.11.0) ECS .NET assembly version (e.g. 1.4.2): v8.11.0 Elasticsearch version (if applicable): v8.14.2 .NET framework / OS: Docker Linux with .net 8 Description of the problem, including expected versus actual behavior:
Hello,
I’m trying to replace the previous Serilog Sink Serilog.Sinks.Elasticsearch with the new one Elastic.Serilog.Sinks.
During our process with add elements in LogContext with LogContext.PushProperty().
When I use LogContext.PushProperty("client.nat.ip", “0.0.0.1”); the value is well set in the Elasticsearch CommonSchema in the client object, but this one no: LogContext.PushProperty("client.ip", “0.0.0.1”);. client.ip is added in the metadata object.
Another one, if I set LogContext.PushProperty("client.user.id", "regis"); no log are sent to elasticsearch. So, it has to fail somewhere.
Steps to reproduce:
Add LogContext.PushProperty("client.ip", “0.0.0.1”);` in a controller or a service
Add LogContext.PushProperty("client.user.id", "regis"); in a controller or a service
Is there a way to me to write tests in Elastic.CommonSchema.Serilog.Tests project ?
The text was updated successfully, but these errors were encountered:
I found why "client.user.id" key wasn't processed (but not why it silently crash...)
I start by adding in class Elastic.CommonSchema.LogTemplateProperties :
// [...]
public static string ClientUserId = nameof(ClientUserId);
// [...]
public static readonly HashSet<string> All = new()
{
// [...]
"client.user.id", ClientUserId,
// [...]
}
And next in class Elastic.CommonSchema. EcsDocument, I add case "client.user.id" in the right part of the switch case and manage it in the method called TrySetClient, like bellow :
ECS integration/library project(s) (e.g. Elastic.CommonSchema.Serilog): Elastic.Serilog.Sinks
ECS schema version (e.g. 1.4.0): The last one (v8.11.0)
ECS .NET assembly version (e.g. 1.4.2): v8.11.0
Elasticsearch version (if applicable): v8.14.2
.NET framework / OS: Docker Linux with .net 8
Description of the problem, including expected versus actual behavior:
Hello,
I’m trying to replace the previous Serilog Sink Serilog.Sinks.Elasticsearch with the new one Elastic.Serilog.Sinks.
During our process with add elements in LogContext with
LogContext.PushProperty()
.When I use
LogContext.PushProperty("client.nat.ip", “0.0.0.1”);
the value is well set in the Elasticsearch CommonSchema in the client object, but this one no:LogContext.PushProperty("client.ip", “0.0.0.1”);
.client.ip
is added in the metadata object.Another one, if I set
LogContext.PushProperty("client.user.id", "regis");
no log are sent to elasticsearch. So, it has to fail somewhere.Steps to reproduce:
LogContext.PushProperty("client.user.id", "regis");
in a controller or a serviceIs there a way to me to write tests in Elastic.CommonSchema.Serilog.Tests project ?
The text was updated successfully, but these errors were encountered: