How to save specific logs from a custom node in the N8N log file?

Guys, when I run my local node in vscode I can get the logs of the inserts I run, but when I use my node in Linux or Docker, the n8n logs are not saved, these logs that I have on my node… someone Do you know how I can save the logs on my node in the n8n logs? Does anyone have an example?

I want to save the console.log(query); in the N8N log file

Look at the example: my node’s insert function generates a log in the console so that I can see if the query was generated correctly, I need these logs to be available somewhere for me to analyze after the application is running on Linux or Docker.

Information on your n8n setup

  • **n8n version:1.51.2
  • **Database (default: SQLite):Postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, Linux):
  • **Operating system:Ubuntu 20.04

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

Hey @leomangueira,

Normally the console.log options should be in the logs but we would recommend against the extra logging as it can lead to data leaks. If you do want to log properly you could try our logger that will then make sure your log lines are outputted.

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