Trying to to set the Elastic Search Tags (In Kibana) for the event being logged. Need to do this so can search and filter on a few specific tags. Trying the code in the lowest level of the logger right before sending it. The tags/properties are applied prior to sending the message as they can't be set when I configure the ElasticSearchTarget when I set up the logger.
Snip of code in the method that ships out the log message
// calling with the tags dictionary set with an element "abc"="def"
_logger = LogManager.GetLogger("Logger");
LogEventInfo theEvent = new LogEventInfo(LogLevel.Info, _logger.Name, "The Log Message");
foreach (KeyValuePair<string, string> tag in tags)
{
theEvent.Properties[tag.Key] = tag.Value;
}
_logger.Info(theEvent);
Should see the regular tags with the addition of the "abc"="def"
Hope this makes sense. Not even really sure this is the right way to do it, but trying to apply this as properties in NLog so it would be not be specific to the ElasticSearch target, but would work if it is.
NLog 4.5.6 and NLog.Target.ElasticSearch 5.0.0 being used.
Trying to to set the Elastic Search Tags (In Kibana) for the event being logged. Need to do this so can search and filter on a few specific tags. Trying the code in the lowest level of the logger right before sending it. The tags/properties are applied prior to sending the message as they can't be set when I configure the ElasticSearchTarget when I set up the logger.
I should add that I saw some of this as part of another Issue https://github.com/ReactiveMarkets/NLog.Targets.ElasticSearch/issues/30 but may need to do more in the config but not really sure if this is something that I should even try.
Snip of code in the method that ships out the log message
Should see the regular tags with the addition of the "abc"="def"
Hope this makes sense. Not even really sure this is the right way to do it, but trying to apply this as properties in NLog so it would be not be specific to the ElasticSearch target, but would work if it is.
NLog 4.5.6 and NLog.Target.ElasticSearch 5.0.0 being used.
Thanks for any help or direction!
Sandy