1

I deployed a web application in node.js by following the guide: Deploying Node.js With Upstart and Monit .

The app produces some log via console.log(). In the upstart script, it's redirected to a log file (exec sudo -u www-data node app.js >> /var/log/app.log).

How do I rotate this log? Do I need some particular treatment in the Javascript code? Can I send kill -USR1 to nodejs like nginx?

1
  • Have you already tried actually doing it? what happens?
    – dawud
    Apr 17, 2014 at 16:06

1 Answer 1

0

If you are using upstart to manage your daemon, issue a reload in the logrotate config for your application. This should redirect your logging to the new file without disrupting the app.

1
  • Thanks, but reload myapp will actually shut down the app without restarting. My .conf (init) script do not have a reload section.
    – He Shiming
    Apr 18, 2014 at 0:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .