Common logging for node, express application — best practice?

后端 未结 2 977
广开言路
广开言路 2021-01-04 04:46

I\'m working on an node.js application with several dozen modules and using bunyan for logging (JSON output, multiple configurable streams). I\'ve been looking for good e

2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-04 05:40

    if you are using express with node.js then you can try this. By default, logging is disabled in Express. You have to do certain stuff to get logs working for your app. For access logs, we need to use the Logger middleware; for error logs we will use Forever.Hope it will help you.. Here is a good example How to Logging Access and Errors in node.js

提交回复
热议问题