开发者

What log level to use for method enter/exit?

开发者 https://www.devze.com 2023-03-15 05:34 出处:网络
What log level should one use for method exit/enter? The log4j levels follow the following order. DEBUG

What log level should one use for method exit/enter?

The log4j levels follow the following order.
DEBUG
I开发者_如何学JAVANFO
WARN
ERROR
FATAL


I have always used DEBUG because it seems this info was only necessary to me when there was an issue and I needed to debug the application.


Trace is the most detailed level, print any information as long as it helps you to find out problems. Debug is the second detailed level, Info is the third detailed level, in my opinion it should print something that is meaningful to the end users, it should hide technical details. ...

So in your case, method enter/exit is probably the most detailed information, it is generally meaningless to the end users, so it is better to use Trace or Debug level.

One example, when you are starting Tomcat, it prints out Info level things to help you tracking the status.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号