Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pm2-logrotate always using default setting max_size #187

Open
nguyenngoc2505 opened this issue Nov 14, 2023 · 0 comments
Open

pm2-logrotate always using default setting max_size #187

nguyenngoc2505 opened this issue Nov 14, 2023 · 0 comments

Comments

@nguyenngoc2505
Copy link

nguyenngoc2505 commented Nov 14, 2023

I've set config for pm2 log like: pm2 set pm2-logrotate:max_size 5G and expect that log will be rotated (flushed) every time log file reaches 5G but in fact it always rotate when the log file reaches 10M (by default settings) and it didn't compress too
This is my config

Module: pm2-logrotate
$ pm2 set pm2-logrotate:max_size 5G
$ pm2 set pm2-logrotate:retain 30
$ pm2 set pm2-logrotate:compress true
$ 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 false

Always rotate when log file reached 10M zzz

ll logs/
-rw-rw-r-- 1 user user 10891103 Nov 14 05:55 app-out__2023-11-14_05-55-55.log
-rw-rw-r-- 1 user user 10787718 Nov 14 06:04 app-out__2023-11-14_06-04-25.log
-rw-rw-r-- 1 user user 10970668 Nov 14 06:13 app-out__2023-11-14_06-13-25.log
-rw-rw-r-- 1 user user 10531002 Nov 14 06:22 app-out__2023-11-14_06-22-55.log
-rw-rw-r-- 1 user user 10711930 Nov 14 06:32 app-out__2023-11-14_06-32-25.log
-rw-rw-r-- 1 user user 10811828 Nov 14 06:40 app-out__2023-11-14_06-40-25.log
-rw-rw-r-- 1 user user 10628306 Nov 14 06:49 app-out__2023-11-14_06-49-25.log
-rw-rw-r-- 1 user user 10964841 Nov 14 07:01 app-out__2023-11-14_07-01-25.log
-rw-rw-r-- 1 user user 10671582 Nov 14 07:13 app-out__2023-11-14_07-13-25.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant