egg-logrotater

1.0.1 • Public • Published

egg-logrotater

NPM version build status Test coverage David deps Known Vulnerabilities npm download

Log rotate plugin for egg, default rotate log files under config.logger.rotateLogDirs.Run by egg-schedule

Install

$ npm i egg-logrotater

Usage

  • plugin.js
exports.logrotater = true;
  • config.default.js
// if any files need rotate by file size, config here
exports.logrotater = {
  filesRotateBySize: [],           // Array for files path which need rotate.
  maxFileSize: 50 * 1024 * 1024,   // Max file size to judge if any file need rotate
  maxFiles: 10,                    // pieces rotate by size
  rotateDuration: 60000,           // time interval to judge if any file need rotate
  maxDays: 31,                     // keep max days log files, default is `31`. Set `0` to keep all logs
};

Questions & Suggestions

Please open an issue here.

License

MIT

/egg-logrotater/

    Package Sidebar

    Install

    npm i egg-logrotater

    Weekly Downloads

    18

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • jtyjty99999
    • atian25
    • dead_horse
    • fengmk2
    • popomore
    • eggjs-admin