Sending n8n's console output to a log on Windows

We are running n8n on Windows (as a service using NSSM) and monitoring its uptime by retrieving healthz/readiness

weirdly our monitoring siftware is reporting that usually takes under 367 ms but occasionally it’ll take as much as 2456 ms which it then raises as an alert.

I would like to understand more about what is happening on the n8n side but understand the only place to see really low-level detail is by capturing the console as a log.

Whlist I (or an LLM) could re-write the batch or powershell, I can’t be the first person to do this so was wondering it there alternative that includes this logging?

For now, I am going to see if I can get NSSM to do it

Hello @Neil_Carmichael

See here, you can set these env vars and store to file, I would recommend using the metrics endpoint also.

n8n.log.level N8N_LOG_LEVEL The log output level. The available options are (from lowest to highest level) are error, warn, info, and debug. The default value is info. You can learn more about these options here.
n8n.log.output N8N_LOG_OUTPUT Where to output logs. The available options are console and file. Multiple values can be used separated by a comma (,). console is used by default.

I’d recommend using WSL also if not already, this can help when access dockers on windows machines saves some issues.

Also, I made this which may be useful for you regarding the metrics I mentioned earlier.

Hope this helps,

Samuel