1
0
Fork 0
mirror of synced 2024-07-09 00:06:05 +12:00

Add service name to the logs only on self-host

This commit is contained in:
Adria Navarro 2023-07-21 14:16:43 +02:00
parent d77a4062c7
commit 2dcb1a67a1

View file

@ -19,8 +19,14 @@ if (!env.DISABLE_PINO_LOGGER) {
return { level: label.toUpperCase() }
},
bindings: () => {
return {
service: env.SERVICE_NAME,
if (env.SELF_HOSTED) {
// "service" is being injected in datadog using the pod names,
// so we should leave it blank to allow the default behaviour if it's not running self-hosted
return {
service: env.SERVICE_NAME,
}
} else {
return {}
}
},
},