{"id":15029308,"url":"https://github.com/keymetrics/pm2-logrotate","last_synced_at":"2025-04-08T08:15:38.333Z","repository":{"id":30810035,"uuid":"34367178","full_name":"keymetrics/pm2-logrotate","owner":"keymetrics","description":"Automatically rotate all applications logs managed by PM2 ","archived":false,"fork":false,"pushed_at":"2024-04-23T09:16:31.000Z","size":104,"stargazers_count":1270,"open_issues_count":95,"forks_count":136,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-04-01T05:34:43.892Z","etag":null,"topics":["cron","easy","keymetrics","logrotate","logrotation","logs","monitor","pm2","rotated"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/keymetrics.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-04-22T03:48:25.000Z","updated_at":"2025-03-27T12:52:33.000Z","dependencies_parsed_at":"2024-06-18T13:38:32.191Z","dependency_job_id":"aacd7afa-80ce-4ab6-9b27-ef91e9636cbf","html_url":"https://github.com/keymetrics/pm2-logrotate","commit_stats":null,"previous_names":["pm2-hive/pm2-logrotate"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keymetrics%2Fpm2-logrotate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keymetrics%2Fpm2-logrotate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keymetrics%2Fpm2-logrotate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keymetrics%2Fpm2-logrotate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keymetrics","download_url":"https://codeload.github.com/keymetrics/pm2-logrotate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247423500,"owners_count":20936622,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cron","easy","keymetrics","logrotate","logrotation","logs","monitor","pm2","rotated"],"created_at":"2024-09-24T20:10:16.310Z","updated_at":"2025-04-08T08:15:38.315Z","avatar_url":"https://github.com/keymetrics.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"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:\u003cparam\u003e \u003cvalue\u003e`\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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeymetrics%2Fpm2-logrotate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeymetrics%2Fpm2-logrotate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeymetrics%2Fpm2-logrotate/lists"}