我想禁用一些使用pm2运行的快速代码的日志(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
/dev/null
传递给error_file或out_file以禁用日志保存-
不起作用,我仍然可以看到日志Run pm2 using command - pm2 start consumer -o "/dev/null" -e "/dev/null" - Not works.
DEBUG=express.* node index.js
运行它-没用。答案 0 :(得分:0)
我设法通过添加以下环境变量来完成它 process.env.DEBUG = false