方法进入/退出使用什么日志级别?
方法退出/进入应该使用什么日志级别?
The log4j levels follow the following order.
DEBUG
INFO
WARN
ERROR
FATAL
What log level should one use for method exit/enter?
The log4j levels follow the following order.
DEBUG
INFO
WARN
ERROR
FATAL
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我一直使用 DEBUG,因为似乎只有当出现问题并且我需要调试应用程序时才需要此信息。
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是最详细的级别,打印任何信息只要能帮助你找出问题即可。调试是第二个详细级别,信息是第三个详细级别,在我看来,它应该打印对最终用户有意义的内容,它应该隐藏技术细节。
...
所以在你的情况下,方法进入/退出可能是最详细的信息,它通常对最终用户没有意义,所以最好使用跟踪或调试级别。
举个例子,当您启动 Tomcat 时,它会打印出 Info 级别的内容来帮助您跟踪状态。
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.