Created
October 30, 2017 12:48
-
-
Save edencorbin/b4c10f24b4a7d05062895fcad8dc9742 to your computer and use it in GitHub Desktop.
Sails 1.0 Winston Daily Rotate File
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var winston = require('winston'); | |
require('winston-daily-rotate-file'); | |
var logger = new (winston.Logger)({ | |
transports: [ | |
new (winston.transports.Console)({ | |
level: 'verbose', | |
colorize: false, | |
json: false | |
}), | |
new winston.transports.DailyRotateFile( | |
{ | |
name: 'mainlog', level: "debug", handleExceptions: true, | |
filename: './logs/log', | |
maxsize: 100000000, maxFiles: 10, | |
datePattern: '.yyyy-MM-dd' | |
}) | |
] | |
}); | |
module.exports.log = { | |
custom: logger | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment