Git Product home page Git Product logo

pm2-logrotate's Introduction

Description

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

Install

pm2 install pm2-logrotate

Configure

There are 3 values that you need to configure :

  • max_size (Defaults to 10MB): When a file size becomes higher than this value it will split it. You can specify the unit at then end: 10G, 10M, 10K
  • interval (Defaults to 1):
  • interval_unit (Defaults to 'DD'): interval and interval_unit works together, it means if you have interval_unit='DD' and interval=3, it will split the logs every 3 days.
  • retain (Defaults to all): 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.

Possible values for interval_unit are 'MM' (months), 'DD' (days), 'mm' (minutes). eg: interval:9, interval_unit:'mm' will split the logs every 9 minutes.

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:interval_unit 'MM' (Months)

pm2-logrotate's People

Contributors

daraghking avatar hemanthmalla avatar jshkurti avatar unitech avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.