-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NLog EcsLayout - Added support for ProcessThreadName + MessageTemplate #348
Conversation
904d284
to
b29df95
Compare
e3d858e
to
173aefd
Compare
@Mpdreamz Really confused by this logic in public static void SetMetaOrLabel(EcsDocument document, string path, object value)
{
switch (value)
{
case string s:
document.Labels ??= new Labels();
document.Labels[path] = s;
break;
case bool b:
document.Labels ??= new Labels();
document.Labels[path] = b.ToString(CultureInfo.InvariantCulture).ToLowerInvariant();
break;
default:
document.Metadata ??= new MetadataDictionary();
document.Metadata[path] = value;
break;
}
} Why does the field-datatype control whether it is Notice NLog Layout has support for explict specifying both: <layout xsi:type="EcsLayout">
<metadata name="MyProperty" layout="MyPropertyValue" /> <!-- repeated, optional -->
<label name="MyLabel" layout="MyLabelValue" /> <!-- repeated, optional -->
<tag layout="MyTagValue" /> <!-- repeated, optional -->
</layout> Think it is confusing that if you have explictly specified |
@snakefoot this is to align with the ECS guidelines around specifying unknown fields: https://www.elastic.co/guide/en/ecs/current/ecs-custom-fields-in-ecs.html#_the_labels_field
This is a step to move to I do think However in that case in the long run we might run into a separation of Will follow up in the ECS repository to discuss long term plans there. |
run docs-build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you for implementing this, @snakefoot.
"Original"-field was removed from "Log"-section with #194 . Now trying to restore it as "MessageTemplate" property.
Curious where the recommended place to put the original "MesageTemplate". See also: https://discuss.elastic.co/t/log-original-field-lost-with-upgrade-8-6-1-from-1-5-3/348363
Have tried to follow the Elastic Extensions logging, so "MesageTemplate" becomes additional property. See also: https://www.elastic.co/guide/en/ecs-logging/dotnet/current/extensions-logging-data-shipper.html#_example_document