node.js - 节点 Winston 记录部分数据
问题描述
我刚刚winston
从版本 2.4.4 更新到 3.1.2。以前它工作得很好,但现在它只记录消息的某些部分。
我有很多日志使生活成为现实:
logger.log("Operation 1", param1, param2, param3)
logger.error("Error 1", err, param1, param2)
在旧版本中记录的参数但在最新版本中只记录了forst字符串......有没有办法记录所有数据?
我附上我的配置
const fileTransport = new winston.transports.File({
timestamp: () => moment().format('DD/MM/YYYY h:mm:ss:SSS'),
filename: process.env.LOG_FILE,
format: winston.format.json(),
prettyPrint: true,
maxsize: 5e+6,
})
const consoleTransport = new winston.transports.Console({
timestamp: () => moment().format('DD/MM/YYYY h:mm:ss:SSS'),
colorize: true,
format: winston.format.combine(
winston.format.colorize(),
winston.format.timestamp(),
winston.format.prettyPrint(),
winston.format( (info, opts) => {
console.log(info)
return `${info.timestamp} - ${info.level}: ${info.message} ${_.join(info.splat, ',')}`
})
),
})
谢谢!
解决方案
推荐阅读
- excel - VBA 图片分辨率
- ios - Html2pdf.js (ekoopmans) 工具生成任何 iOS 设备中的所有空白页,当我们生成 20 多页 PDF 时,一些最后一页数据丢失
- java - 找不到 SyncConfiguration(或 Realm 的等效类)
- virtual - Visual Studio 16.8.4 创建的 IIS 虚拟目录
- java - Cucumber 特征中的递增变量
- haskell - 具有受另一个类型变量约束的类型变量的 Rank-2 多态性
- javascript - 通过单击发送相应组件的 id
- google-chrome - devdocs.io 窃取 alt+d 快捷方式
- python - 发布以增加相关表 Django
- android - Android Studio:无法检测 adb 版本,退出值:0xc0000139