keymetrics / pm2-logrotate

Automatically rotate all applications logs managed by PM2
1.24k stars 138 forks source link

Keep original file extension when rotation occurs (e.g. .error files) #161

Open e-dot opened 4 years ago

e-dot commented 4 years ago

Handle file extension properly : if the extension is not .log, use the same extension for rotated files (e.g. if you rotate .error file, it will keep the .error extension).

e-dot commented 4 years ago

I'm using logrotate to rotate .log and .err files ; keeping the file extension unchanged when rotation occurs is a must-have for our team.

E.

xioustic commented 2 years ago

any reason this either wasn't pulled in or has regressed back out of the code? the current install i have has been bulldozing my .err files by renaming them .log, which is usually then overwritten by the stdout .log file that follows. i dropped this diff in manually and it seemed to fix things.