Not seeing logs added in code node in server Logs

Describe the problem/error/question

console.log added in code node is not showing up on server logs.

What is the error message (if any)?

I have set the log level as debug. its even showing sendConsoleMessage command in log. But, not showing what I added in console.log

Please share your workflow

Logs are given below.

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Main

Received pubsub msg: relay-execution-lifecycle-event (executionStarted) {“scopes”:[“scaling”,“pubsub”],“msg”:“relay-execution-lifecycle-event”,“channel”:“n8n.commands”,“type”:“executionStarted”,“executionId”:“19”,“file”:“subscriber.service.js”,“function”:“parseMessage”}

Pushed to frontend: executionStarted {“dataType”:“executionStarted”,“pushRefs”:“9yar8iovzn”,“file”:“abstract.push.js”,“function”:“sendTo”}

Received pubsub msg: relay-execution-lifecycle-event (nodeExecuteBefore) {“scopes”:[“scaling”,“pubsub”],“msg”:“relay-execution-lifecycle-event”,“channel”:“n8n.commands”,“type”:“nodeExecuteBefore”,“executionId”:“19”,“file”:“subscriber.service.js”,“function”:“parseMessage”}

Pushed to frontend: nodeExecuteBefore {“dataType”:“nodeExecuteBefore”,“pushRefs”:“9yar8iovzn”,“file”:“abstract.push.js”,“function”:“sendTo”}

Received pubsub msg: relay-execution-lifecycle-event (nodeExecuteAfter) {“scopes”:[“scaling”,“pubsub”],“msg”:“relay-execution-lifecycle-event”,“channel”:“n8n.commands”,“type”:“nodeExecuteAfter”,“executionId”:“19”,“file”:“subscriber.service.js”,“function”:“parseMessage”}

Pushed to frontend: nodeExecuteAfter {“dataType”:“nodeExecuteAfter”,“pushRefs”:“9yar8iovzn”,“file”:“abstract.push.js”,“function”:“sendTo”}

Received pubsub msg: relay-execution-lifecycle-event (nodeExecuteBefore) {“scopes”:[“scaling”,“pubsub”],“msg”:“relay-execution-lifecycle-event”,“channel”:“n8n.commands”,“type”:“nodeExecuteBefore”,“executionId”:“19”,“file”:“subscriber.service.js”,“function”:“parseMessage”}

Pushed to frontend: nodeExecuteBefore {“dataType”:“nodeExecuteBefore”,“pushRefs”:“9yar8iovzn”,“file”:“abstract.push.js”,“function”:“sendTo”}

Received pubsub msg: relay-execution-lifecycle-event (sendConsoleMessage) {“scopes”:[“scaling”,“pubsub”],“msg”:“relay-execution-lifecycle-event”,“channel”:“n8n.commands”,“type”:“sendConsoleMessage”,“file”:“subscriber.service.js”,“function”:“parseMessage”}

Pushed to frontend: sendConsoleMessage {“dataType”:“sendConsoleMessage”,“pushRefs”:“9yar8iovzn”,“file”:“abstract.push.js”,“function”:“sendTo”}

Received pubsub msg: relay-execution-lifecycle-event (nodeExecuteAfter) {“scopes”:[“scaling”,“pubsub”],“msg”:“relay-execution-lifecycle-event”,“channel”:“n8n.commands”,“type”:“nodeExecuteAfter”,“executionId”:“19”,“file”:“subscriber.service.js”,“function”:“parseMessage”}

Pushed to frontend: nodeExecuteAfter {“dataType”:“nodeExecuteAfter”,“pushRefs”:“9yar8iovzn”,“file”:“abstract.push.js”,“function”:“sendTo”}

Received pubsub msg: relay-execution-lifecycle-event (executionFinished) {“scopes”:[“scaling”,“pubsub”],“msg”:“relay-execution-lifecycle-event”,“channel”:“n8n.commands”,“type”:“executionFinished”,“executionId”:“19”,“file”:“subscriber.service.js”,“function”:“parseMessage”}

Pushed to frontend: executionFinished {“dataType”:“executionFinished”,“pushRefs”:“9yar8iovzn”,“file”:“abstract.push.js”,“function”:“sendTo”}

Execution 19 (job 18) finished successfully {“scopes”:[“scaling”],“workerId”:“worker-owDTaFWnMlJGhx2O”,“executionId”:“19”,“jobId”:“18”,“file”:“scaling.service.js”}

Worker

Received pubsub msg: relay-execution-lifecycle-event (executionStarted) {“scopes”:[“scaling”,“pubsub”],“msg”:“relay-execution-lifecycle-event”,“channel”:“n8n.commands”,“type”:“executionStarted”,“executionId”:“19”,“file”:“subscriber.service.js”,“function”:“parseMessage”}

Received pubsub msg: relay-execution-lifecycle-event (nodeExecuteBefore) {“scopes”:[“scaling”,“pubsub”],“msg”:“relay-execution-lifecycle-event”,“channel”:“n8n.commands”,“type”:“nodeExecuteBefore”,“executionId”:“19”,“file”:“subscriber.service.js”,“function”:“parseMessage”}

Received pubsub msg: relay-execution-lifecycle-event (nodeExecuteAfter) {“scopes”:[“scaling”,“pubsub”],“msg”:“relay-execution-lifecycle-event”,“channel”:“n8n.commands”,“type”:“nodeExecuteAfter”,“executionId”:“19”,“file”:“subscriber.service.js”,“function”:“parseMessage”}

Received pubsub msg: relay-execution-lifecycle-event (nodeExecuteBefore) {“scopes”:[“scaling”,“pubsub”],“msg”:“relay-execution-lifecycle-event”,“channel”:“n8n.commands”,“type”:“nodeExecuteBefore”,“executionId”:“19”,“file”:“subscriber.service.js”,“function”:“parseMessage”}

Received pubsub msg: relay-execution-lifecycle-event (sendConsoleMessage) {“scopes”:[“scaling”,“pubsub”],“msg”:“relay-execution-lifecycle-event”,“channel”:“n8n.commands”,“type”:“sendConsoleMessage”,“file”:“subscriber.service.js”,“function”:“parseMessage”}

Received pubsub msg: relay-execution-lifecycle-event (nodeExecuteAfter) {“scopes”:[“scaling”,“pubsub”],“msg”:“relay-execution-lifecycle-event”,“channel”:“n8n.commands”,“type”:“nodeExecuteAfter”,“executionId”:“19”,“file”:“subscriber.service.js”,“function”:“parseMessage”}

Received pubsub msg: relay-execution-lifecycle-event (executionFinished) {“scopes”:[“scaling”,“pubsub”],“msg”:“relay-execution-lifecycle-event”,“channel”:“n8n.commands”,“type”:“executionFinished”,“executionId”:“19”,“file”:“subscriber.service.js”,“function”:“parseMessage”}

Information on your n8n setup

  • n8n version: 1.90.2
  • Database (default: SQLite): PostgreSQL
  • n8n EXECUTIONS_PROCESS setting (default: own, main): main
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker ( Kubernetes )
  • Operating system:

Have you checked your browser console? console.log calls should appear there when debugging workflows

its showing up in browser console. But, I wanted to capture these in the application logs also.

I tried setting CODE_ENABLE_STDOUT as true as well. But, still same result. As per the doc

Set to true to send Code node logs to process’s stdout for debugging, monitoring, or logging purposes.

So, this is exactly what I want. ( Logs environment variables | n8n Docs ).

Is there any other setting also to be done?

The logs will show up only if the workflow is active. when I tested the workflow, it was not showing. Once I activated the workflow, and also when CODE_ENABLE_STDOUT is set to true, logs are coming

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.