logger.prototype.init = function(){
if(this.writer != null){
return;
}
this.writer = winston.createLogger({
transports: [
new (winstonDaily)({
name: 'info-file',
filename: path.join(utils.LOG_PATH, './server_%DATE%.log'),
datePattern: 'YYYY-MM-DD',
colorize: false,
maxsize: 50000000,
maxFiles: 1000,
level: 'info',
showLevel: true,
json: false,
timestamp: time_stamp_format,
format: winston.format.printf(
info => `${time_stamp_format()} [${info.level.toUpperCase()}] - ${info.message}`
)
}),
new (winston.transports.Console)({
name: 'debug-console',
colorize: true,
level: 'debug',
showLevel: true,
json: false,
timestamp: time_stamp_format,
format: winston.format.printf(
info => `${time_stamp_format()} [${info.level.toUpperCase()}] - ${info.message}`
)
})
]
})
}