winston只有在debugging时才将日志保存到文件中

我在快递应用程序中使用winston。
当我使用node app.js winston运行应用程序时,只logging到控制台,但是如果我使用VSCodedebugging器运行应用程序,它也应该logging到error.log文件。

我正在使用winston v2.3.1,无法升级。

我的代码:

 const logger = new winston.Logger({ transports : [ new winston.transports.Console(), new winston.transports.File({ filename : './app/error.log', handleExceptions: true, humanReadableUnhandledException: true }) ], handleExceptions : true }); 

会是什么呢?