{"_id":"@denizyts/pm2-logrotate","name":"@denizyts/pm2-logrotate","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@denizyts/pm2-logrotate","version":"1.0.0","description":"Module to rotate logs of every pm2 application","main":"app.js","dependencies":{"graceful-fs":"^4.2.2","moment-timezone":"^0.5.11","node-schedule":"^1.3.1","pm2":"latest","pmx":"latest"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"Joni SHKURTI"},"repository":{"type":"git","url":"git+https://github.com/pm2-hive/pm2-logrotate.git"},"bugs":{"url":"https://github.com/pm2-hive/pm2-logrotate/issues"},"homepage":"https://github.com/pm2-hive/pm2-logrotate","license":"MIT","apps":[{"name":"pm2-logrotate","script":"app.js","max_memory_restart":"500M"}],"config":{"max_size":"350M","retain":"30","compress":true,"dateFormat":"YYMMDD_HHmmss","workerInterval":"30","rotateInterval":"0 0 * * *","rotateModule":true},"gitHead":"b9a08d60597d33d34a69935b569a694d208411be","_id":"@denizyts/pm2-logrotate@1.0.0","_nodeVersion":"25.9.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-sDeOjuRcZcLvguqDH3iWdn7Y3uWFuuSQ849B8r12jU5Q8E8CkHhzfpDgYcrwo2ZOxhZw3iTmxrWhkItlTOiegA==","shasum":"86a00e1553bb4b560e9861d2df59eb77f94d1c62","tarball":"https://registry.npmjs.org/@denizyts/pm2-logrotate/-/pm2-logrotate-1.0.0.tgz","fileCount":6,"unpackedSize":14428,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD9dABeWgBT17f2dWJwWyZbPcWczSg1mapnIM8WAVpPaAIgWsj1xCob0+hkNPXHeMbi8ugZX+csIEPDifQjLRxe1aY="}]},"_npmUser":{"name":"denizyts","email":"denizyetis56@gmail.com"},"directories":{},"maintainers":[{"name":"denizyts","email":"denizyetis56@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pm2-logrotate_1.0.0_1779129293848_0.6890820277766234"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-18T18:34:53.754Z","1.0.0":"2026-05-18T18:34:54.030Z","modified":"2026-05-18T18:34:54.385Z"},"maintainers":[{"name":"denizyts","email":"denizyetis56@gmail.com"}],"description":"Module to rotate logs of every pm2 application","homepage":"https://github.com/pm2-hive/pm2-logrotate","repository":{"type":"git","url":"git+https://github.com/pm2-hive/pm2-logrotate.git"},"author":{"name":"Joni SHKURTI"},"bugs":{"url":"https://github.com/pm2-hive/pm2-logrotate/issues"},"license":"MIT","readme":"\n## Description\n\nPM2 module to automatically rotate logs of processes managed by PM2.\n\n## Install\n\n    pm2 install pm2-logrotate\n\n**NOTE:** the command is `pm2 install` NOT `npm install`\n\n## Configure\n\n- `max_size` (Defaults to `10M`): When a file size becomes higher than this value it will rotate it (its possible that the worker check the file after it actually pass the limit) . You can specify the unit at then end: `10G`, `10M`, `10K`\n- `retain` (Defaults to `30` file logs): This number is the number of rotated logs that are keep at any one time, it means that if you have retain = 7 you will have at most 7 rotated logs and your current one.\n- `compress` (Defaults to `false`): Enable compression via gzip for all rotated logs\n- `dateFormat` (Defaults to `YYYY-MM-DD_HH-mm-ss`) : Format of the data used the name the file of log\n- `rotateModule` (Defaults to `true`) : Rotate the log of pm2's module like other apps\n- `workerInterval` (Defaults to `30` in secs) : You can control at which interval the worker is checking the log's size (minimum is `1`)\n- `rotateInterval` (Defaults to `0 0 * * *` everyday at midnight): This cron is used to a force rotate when executed.\nWe are using [node-schedule](https://github.com/node-schedule/node-schedule) to schedule cron, so all valid cron for [node-schedule](https://github.com/node-schedule/node-schedule) is valid cron for this option. Cron style :\n- `TZ` (Defaults to system time): This is the standard [tz database timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) used to offset the log file saved. For instance, a value of `Etc/GMT+1`, with an hourly log, will save a file at hour `14` GMT with hour `13` (GMT+1) in the log name.\n\n```\n*    *    *    *    *    *\n┬    ┬    ┬    ┬    ┬    ┬\n│    │    │    │    │    |\n│    │    │    │    │    └ day of week (0 - 7) (0 or 7 is Sun)\n│    │    │    │    └───── month (1 - 12)\n│    │    │    └────────── day of month (1 - 31)\n│    │    └─────────────── hour (0 - 23)\n│    └──────────────────── minute (0 - 59)\n└───────────────────────── second (0 - 59, OPTIONAL)\n```\n\n### How to view current configuration of the above values ?\nAfter having installed the module, you have to type :\n`pm2 conf`\n\n### How to set these values ?\n\n After having installed the module you have to type :\n`pm2 set pm2-logrotate:<param> <value>`\n\ne.g:\n- `pm2 set pm2-logrotate:max_size 1K` (1KB)\n- `pm2 set pm2-logrotate:compress true` (compress logs when rotated)\n- `pm2 set pm2-logrotate:rotateInterval '*/1 * * * *'` (force rotate every minute)\n","readmeFilename":"README.md","_rev":"1-65eaaac0df0d6a76e389c509da9e8ca2"}