What guidelines do you adhere to for writing good logging statements

后端 未结 7 2200
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-24 07:18

I recently found a log statement in my projects codebase that says \"here i am with search parameter==>===========11/30/2008===1====00:00 AM\"

what guidelines do you

7条回答
  •  误落风尘
    2020-12-24 08:13

    Code variable levels of logging, so you can switch between nothing, basic information on the program flow and insanely detailed information on the inner workings. Then by adjusting the variable that controls logging level you can control how much output you want to receive.

    In large projects where you want to be able to receive logging from customers encountering problems it also helps if you can control which parts of your application will log; for example if there is a problems with reading AD user information you can add "AD_LOGGING=EVERYTHING" and receive detailed logginginformation on that without seeing the log information from every other section of the program.

提交回复
热议问题