Node.js logger with log rotation support
This is a simple logger designed to log messages to your specified log file, which comes with log rotation support, allowing you to rotate the main log file after it gets larger, as well as keeping only the most recent rotated logs by setting a max file value for that.
Install
npm install simple-logger-node --save-dev
Usage
const log = const debug = { return log} // log information // log an array // log an object
Config
This simple logger comes with optional configuration setting:
const log =
The default configuration is:
file: __dirname + '/info.log' maxSizeBytes: 1000000 // 1MB maxFiles: 5 { return + ' - DEBUG - ' + message + '\n' }