What log level to use for method enter/exit?
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.
精彩评论