Winston日志记录未在日志文件中添加时间戳

时间:2019-09-04 16:25:43

标签: node.js logging winston

我正在使用Winston向NodeJS应用程序的日志文件中添加一些日志记录-日志记录本身正在工作,除非我看不到应自动添加的时间戳。有人可以看到我在做什么错吗?

        this.winston = winston.createLogger({
            transports: [
                new (winston.transports.Console)({json: false, timestamp: true}),
                new winston.transports.File({ 
                  filename: `${logPath}/${moment().format('YYYY-MM-DD')}.log`,
                  json: false,
                  timestamp: true
                })
            ]
        });

0 个答案:

没有答案