当记录器导出到新文件时,它不会创建日志, 我有两个文件
1] abc.js
let winston = require('winston');require('winston-logrotate');
var logger = new winston.Logger({
level: 'info',
transports: [
new (winston.transports.File)({ filename: 'somefile.log' })
]
});
module.exports = logger;
2] app.js
const logger = require('./abc');
logger.info("is it working"); // not change is made in the log file after this command
console.log(logger); // this is working