What logging is good logging for your app?

前端 未结 7 1282
不思量自难忘°
不思量自难忘° 2021-02-05 18:13

So we\'ve discussed logging in passing at my place of work and I was wondering if some of you guys here could give me some ideas of your approaches?

Typically our scenar

7条回答
  •  走了就别回头了
    2021-02-05 18:19

    As a quick answer I would say to come up with a series of categories and have switchable logging levels, e.g. info, warning, error, critical, etc.

    Then make it easy to set the logging level to tune the level of detail that you need. Typically, set the logging level in a config file and stop and restart the app.

    I would also publicize to the developers what the meaning is for each of the levels.

    edit: I would also set up a system to rotate out, compress and archive log files on a regular basis, maybe nightly.

提交回复
热议问题