keymetrics / pm2-logrotate

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

Max size not being used #180

Open FayKn opened 2 years ago

FayKn commented 2 years ago

I have the following config

$ pm2 set pm2-logrotate:max_size 10K
$ pm2 set pm2-logrotate:retain 7
$ pm2 set pm2-logrotate:compress false
$ pm2 set pm2-logrotate:dateFormat YYYY-MM-DD_HH-mm-ss
$ pm2 set pm2-logrotate:workerInterval 30
$ pm2 set pm2-logrotate:rotateInterval */0 0 12 10 *
$ pm2 set pm2-logrotate:rotateModule true

And so you'd expect files that are larger then 10kb to not happen but then I find files that are 40kb, could I be doing something wrong?

the file in question is named index-error__2022-04-01_11-31-16.log

server is running AlmaLinux- 8 and it's hosting a Nuxt.js app

Thanks!

victorykong commented 2 years ago

@vmarchaud @jshkurti
I have the same problem.I'm very much looking forward to a reply.

➜  node-bff git:(master) ✗ ./node_modules/.bin/pm2 set pm2-logrotate:max_size 1K  
➜  node-bff git:(master) ✗ ./node_modules/.bin/pm2 conf    
Module: pm2-logrotate
$ pm2 set pm2-logrotate:max_size 10M
$ pm2 set pm2-logrotate:retain 30
$ pm2 set pm2-logrotate:compress false
$ pm2 set pm2-logrotate:dateFormat YYYY-MM-DD_HH-mm-ss
$ pm2 set pm2-logrotate:workerInterval 30
$ pm2 set pm2-logrotate:rotateInterval 0 0 * * *
$ pm2 set pm2-logrotate:rotateModule true
Module: module-db-v2
$ pm2 set module-db-v2:pm2-logrotate [object Object]
➜  node-bff git:(master) ✗ 
ducdev commented 2 years ago

Same issue!

trmaphi commented 2 years ago

Same issue. It eats up my hard drive.

m-cisse-easy-live commented 1 year ago

has there been any correction since?