Hi everyone,
I was hoping you could help me with some logging issues we’re experiencing with n8n and Datadog.
We have n8n running in our Kubernetes cluster, along with a Datadog agent for observability. We use OpenTelemetry to forward logs from k8s pods to DataDog. However, I’ve noticed that n8n logs appear fragmented in Datadog. Since these logs are generated by Node.js/JavaScript, they are multi-line, and Datadog splits a single log into multiple entries whenever it encounters a newline character.
This causes problems such as:
- One log being split into multiple entries.
- Logs getting mixed up.
- An abundance of logs consisting solely of a closing curly bracket (“}”).
To address this, I’m wondering if there’s a way for n8n to send structured JSON logs, which would prevent these issues.
I came across the N8N_LOG_OUTPUT
variable in your documentation here, but the description only mentions “Where to output logs” and has “console” and “file” as options for log output. This doesn’t seem to cover structured JSON logging. I also searched for “json” and “log” in your documentation but couldn’t find relevant information.
Am I looking in the wrong place?
Is there a way to configure n8n to produce JSON or structured logs that we can leverage in Datadog?
Thank you in advance for your help,
Mike S
Information on your n8n setup
- n8n version: 1.37.2
- Database (default: SQLite): Redis
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app): docker image: n8nio/n8n:0.149.0
- Operating system: