Closed
Description
I noticed when I was working with the ECS NodeJS loggers that Metadata fields weren't name spaced.
I can see one of three scenario's:
- Make the default namespace be
labels
per [https://www.elastic.co/guide/en/ecs/current/ecs-base.html](Base Fields) - Make the default namespace be
tags
per [https://www.elastic.co/guide/en/ecs/current/ecs-base.html](Base Fields) - Allow for a customized namespace via a configuration parameter.
Here's an example configuration:
const logger = winston.createLogger({
format: ecsFormat(),
level: "debug",
defaultMeta: {
defaultMeta: {
'environment': 'dev'
}
},
transports: [
new winston.transports.Console()
]
})
and a resulting output:
{
"@timestamp": "2021-08-20T15:43:32.147Z",
"log.level": "debug",
"message": "Example with the default Meta Data fields.",
"ecs": {
"version": "1.6.0"
},
"environment": "dev"
}