egg-logrotater
v1.0.1
Published
logrotater for egg
Downloads
40
Readme
egg-logrotater
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.