All Projects → keymetrics → Pm2 Logrotate

keymetrics / Pm2 Logrotate

Automatically rotate all applications logs managed by PM2

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Pm2 Logrotate

pm2-docker
Monitor Docker Daemon (expose host docker daemon for monitoring)
Stars: ✭ 21 (-97.68%)
Mutual labels:  monitor, pm2
Pm2 Syslog
PM2 module to redirect application logs to syslog
Stars: ✭ 34 (-96.24%)
Mutual labels:  monitor, pm2
pm2-io-apm
PM2.io APM for Node.JS
Stars: ✭ 131 (-85.52%)
Mutual labels:  logs, pm2
Pm2 Server Monit
Monitor server CPU / Memory / Process / Zombie Process / Disk size / Security Packages / Network Input / Network Output
Stars: ✭ 247 (-72.71%)
Mutual labels:  monitor, pm2
pm2-server-monitor
The monitor for pm2 node.js servers, with nice web UI.
Stars: ✭ 34 (-96.24%)
Mutual labels:  monitor, pm2
Informer
A Telegram Mass Surveillance Bot in Python
Stars: ✭ 745 (-17.68%)
Mutual labels:  monitor
Ezapi
Stars: ✭ 5 (-99.45%)
Mutual labels:  easy
Androidperformancemonitor
A transparent ui-block detection library for Android. (known as BlockCanary)
Stars: ✭ 6,241 (+589.61%)
Mutual labels:  monitor
Cron Utils
Cron utils for parsing, validations and human readable descriptions as well as date/time interoperability.
Stars: ✭ 724 (-20%)
Mutual labels:  cron
Node Procedural Async
Write procedural style code that runs asynchronously. It may look synchronous, but it's not!
Stars: ✭ 17 (-98.12%)
Mutual labels:  easy
React Cool Inview
😎 🖥️ React hook to monitor an element enters or leaves the viewport (or another element).
Stars: ✭ 830 (-8.29%)
Mutual labels:  monitor
Loghouse
Ready to use log management solution for Kubernetes storing data in ClickHouse and providing web UI.
Stars: ✭ 805 (-11.05%)
Mutual labels:  logs
Watchme
Reproducible watchers for research
Stars: ✭ 756 (-16.46%)
Mutual labels:  cron
Ruby Stats
Fetch statistics about your machine using Ruby
Stars: ✭ 5 (-99.45%)
Mutual labels:  monitor
Opstrace
Secure observability, deployed in your own network. An open source alternative to SaaS solutions like Datadog, SignalFx, ...
Stars: ✭ 743 (-17.9%)
Mutual labels:  logs
Ppscripts
Post-processing scripts for Sick Beard, NzbDrone/sonarr and CouchPotato Server
Stars: ✭ 6 (-99.34%)
Mutual labels:  cron
Ekanite
The Syslog server with built-in search
Stars: ✭ 729 (-19.45%)
Mutual labels:  logs
Cron Parser
Node.js library for parsing crontab instructions
Stars: ✭ 802 (-11.38%)
Mutual labels:  cron
Prometheusalert
Prometheus Alert是开源的运维告警中心消息转发系统,支持主流的监控系统Prometheus,Zabbix,日志系统Graylog和数据可视化系统Grafana发出的预警消息,支持钉钉,微信,华为云短信,腾讯云短信,腾讯云电话,阿里云短信,阿里云电话等
Stars: ✭ 822 (-9.17%)
Mutual labels:  monitor
Owl
distributed monitoring system
Stars: ✭ 794 (-12.27%)
Mutual labels:  monitor

Description

PM2 module to automatically rotate logs of processes managed by PM2.

Install

pm2 install pm2-logrotate

NOTE: the command is pm2 install NOT npm install

Configure

  • 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
  • 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.
  • compress (Defaults to false): Enable compression via gzip for all rotated logs
  • dateFormat (Defaults to YYYY-MM-DD_HH-mm-ss) : Format of the data used the name the file of log
  • rotateModule (Defaults to true) : Rotate the log of pm2's module like other apps
  • workerInterval (Defaults to 30 in secs) : You can control at which interval the worker is checking the log's size (minimum is 1)
  • rotateInterval (Defaults to 0 0 * * * everyday at midnight): This cron is used to a force rotate when executed. We are using node-schedule to schedule cron, so all valid cron for node-schedule is valid cron for this option. Cron style :
  • TZ (Defaults to system time): This is the standard tz database timezone 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.
*    *    *    *    *    *
┬    ┬    ┬    ┬    ┬    ┬
│    │    │    │    │    |
│    │    │    │    │    └ day of week (0 - 7) (0 or 7 is Sun)
│    │    │    │    └───── month (1 - 12)
│    │    │    └────────── day of month (1 - 31)
│    │    └─────────────── hour (0 - 23)
│    └──────────────────── minute (0 - 59)
└───────────────────────── second (0 - 59, OPTIONAL)

How to set these values ?

After having installed the module you have to type : pm2 set pm2-logrotate:<param> <value>

e.g:

  • pm2 set pm2-logrotate:max_size 1K (1KB)
  • pm2 set pm2-logrotate:compress true (compress logs when rotated)
  • pm2 set pm2-logrotate:rotateInterval '*/1 * * * *' (force rotate every minute)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].