Skip to content

Instantly share code, notes, and snippets.

@edencorbin
Created October 30, 2017 12:48
Show Gist options
  • Save edencorbin/b4c10f24b4a7d05062895fcad8dc9742 to your computer and use it in GitHub Desktop.
Save edencorbin/b4c10f24b4a7d05062895fcad8dc9742 to your computer and use it in GitHub Desktop.
Sails 1.0 Winston Daily Rotate File
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