Search code examples
linuxnode.jsmonit

Confusion over where standard out goes with monit process


I've been trying to set up logging for my node.js app, using monit to monitor and restart the app. One question I have is, where does the standard output go? For instance, if my monit config looks like this:

check host node_web_app_beehive with address 127.0.0.1
  start program = "/bin/bash -c 'cd /srv/www/beehive/current ; source /srv/www/beehive/shared/app.env ; /usr/bin/env PORT=80$
  stop program = "/usr/bin/pkill -f 'node /srv/www/beehive/current/server.js'"
  if failed port 80 protocol HTTP
    request /
    with timeout 10 seconds
    then restart

Where does the console output go of the node process, assuming I have not redirected or logged it? Thank you.


Solution

  • It looks like your config got truncated by your editor, but you should be able to use normal redirection to send stdout wherever you want. I've done that plenty of times with monit.