【发布时间】:2019-12-10 09:26:25
【问题描述】:
我的日志需要采用.json 格式,目前我使用express-js 服务器,我的日志如下所示:
Error: Cannot return null for non-nullable field Query.get_bar.
Error: Cannot return null for non-nullable field Query.get_bar.
Error: Cannot return null for non-nullable field Query.get_foo.
我发现有一些记录器框架(log4js、winstonjs)但我不想手动记录(即console.log(123)),我有兴趣重定向我的 STDOUT,将其转换为 JSON 并写入一些.log 文件。
这个任务最简单的解决方案是什么?
更新:GitHub 上有一个related 问题。
【问题讨论】:
标签: javascript node.js winston log4js-node