【发布时间】:2016-04-18 02:23:06
【问题描述】:
我只需要这样的 example.js 文件中的 winston
var winston = require('winston');
//Bla Bla Bla Bla
当运行此代码时,winston 会创建两个文件 example.log 和 example_err.log,我只是想知道它是默认的 winston 行为还是我的代码中的某些东西使 winston 表现得像那样?
以防万一我不使用任何winston.info 或winston.error。
更新 1
example.log 包含 stdout 的所有输出,example_err.log 包含 example.js 中发生的所有异常
【问题讨论】:
-
这些文件名不会出现在
winston包中的任何位置。该文档还指出“默认情况下,默认记录器上仅设置控制台传输”。所以在你的情况下还有其他事情发生。