Friday 2 June 2017

Disable PM2 logging(.pm2/pm2.log NOT .pm2/logs)

I have to run a process with PM2 on a device with very limited disk space, so I need to disable all logging otherwise the device will run out of space after several days.

I'm using:

"out_file": "/dev/null",
"error_file": "/dev/null"

It stops PM2 from creating logs for the process. However, PM2 still creates another log file in .pm2/pm2.log

The size of pm2.log can grow up to 9Mb, which is large for the device. Is there any way to stop PM2 from creating pm2.log? Or at least some way to clean the log file automatically.



via Jonathan Tsai

No comments:

Post a Comment