Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5049

pm2 is writing logs to rotated file, i.e, .log.1 file

$
0
0

I have the following logrotate configuration:

/var/log/app.*/*.log {
    su root root
    daily
    missingok
    notifempty
    create 0644 root root
    rotate 4
}

/var/log/app.*/*.log are the files where pm2 write logs. The problem is when the files are rotated pm2 starts writing to *.log.1 files. When rotated again it writes to *.log.2 files.

I've found two solutions,

  1. use copytruncate in the logrotate configuration.

  2. run pm2 reload ecosystem.config.js

My use case is such that I don't want to use copytruncate neither do I wanna reload pm2.

Any suggestions will be highly appreciated.


Viewing all articles
Browse latest Browse all 5049

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>