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
Hello,
I'm using Serilog + Serilog.Sinks.Logz.io to send event to Logzio (europe).
I've been contacted by the support since they told me that I've tons of log message that cannot be indexed since I used the Scope.
In particular consider this case
They wrote me :" Im still checking, but it looks to be from the field "properties.Scope_list". The field is getting sent as an array and causing index failures"
My code is thefollowing, since I have those properties that needs to be attached to all the nested logs starting from the using:
To be honest - for me all these things looks legit, as ElasticSearch/OpenSearch supports arrays without any issues, see: https://www.elastic.co/guide/en/elasticsearch/reference/current/array.html
However - maybe the issue is that you have these arrays create in multiple places with the same name, but inside you have different properties?
By looking more closely.. it seems like with a single log message you need only one pair of ProductInventoryId and ExternalProductId, is that right?
Because now.. since you are not disposing scope - every log line gets more and more these entries.
So one way would be (see added using):
foreach (var productInventoryIdByExternalProductId in filtered)
{
using var scope = _logger.BeginScope(new Dictionary<string, string>()
{
{ "ProductInventoryId", productInventoryIdByExternalProductId.Key.ToString() },
{"ExternalProductId", productInventoryIdByExternalProductId.Value}
});
_logger.LogInformation($"Started processing ProductInventoryId: {productInventoryIdByExternalProductId.Key} .[{count}/{total}]");
Hello,
I'm using Serilog + Serilog.Sinks.Logz.io to send event to Logzio (europe).
I've been contacted by the support since they told me that I've tons of log message that cannot be indexed since I used the Scope.
In particular consider this case
They wrote me :" Im still checking, but it looks to be from the field "properties.Scope_list". The field is getting sent as an array and causing index failures"
My code is thefollowing, since I have those properties that needs to be attached to all the nested logs starting from the using:
What am I doing wrong?
Thanks
The text was updated successfully, but these errors were encountered: