首页 > 解决方案 > 无法禁用以下 express:* 相关 pm2 日志?

问题描述

我想从使用 pm2 运行的 express 代码中禁用一些日志(express:router)。当前日志如下

GMT express:router dispatching GET /healthcheck
10|consumer  | Wed, 10 Oct 2018 19:40:04 GMT express:router query  : /healthcheck
10|consumer  | Wed, 10 Oct 2018 19:40:04 GMT express:router expressInit  : /healthcheck
10|consumer  | Wed, 10 Oct 2018 19:40:04 GMT express:router corsMiddleware  : /healthcheck
10|consumer  | Wed, 10 Oct 2018 19:40:04 GMT express:router jsonParser  : /healthcheck
10|consumer  | Wed, 10 Oct 2018 19:40:04 GMT body-parser:json skip empty body
10|consumer  | Wed, 10 Oct 2018 19:40:04 GMT express:router urlencodedParser  : /healthcheck
10|consumer  | Wed, 10 Oct 2018 19:40:04 GMT body-parser:urlencoded skip empty body

标签: node.jsexpresspm2pm2-logrotate

解决方案


我设法通过添加以下环境 var process.env.DEBUG=false 来完成它


推荐阅读