2017-09-11 22:54:15 +08:00
|
|
|
const winston = require("winston");
|
2014-11-15 00:12:37 +08:00
|
|
|
|
2017-09-11 22:54:15 +08:00
|
|
|
const logger = new (winston.Logger)({
|
2014-11-15 00:12:37 +08:00
|
|
|
transports: [
|
|
|
|
new (winston.transports.Console)({ timestamp: true, colorize: true }),
|
|
|
|
new (winston.transports.File)({ filename: "log/application.log", timestamp: true })
|
|
|
|
]
|
2017-09-11 22:54:15 +08:00
|
|
|
});
|
2014-11-15 00:12:37 +08:00
|
|
|
|
2017-09-11 22:54:15 +08:00
|
|
|
module.exports = logger;
|