how to enable package level logging in log4j

五迷三道 提交于 2019-12-05 15:35:16

问题


Can any one tell me, what is package level logging in log4j ? And how to enable this, today my interview question am unable to answer this :-(

Even i didn't find good solution in Google.

thank you so much.


回答1:


Package level logging is the standard logging of log4j. With log4j configuration, you'd specify the package and the associated level.

In the intro example, there is package level logging for "com.foo".

# Print only messages of level WARN or above in the package com.foo.
log4j.logger.com.foo=WARN


来源:https://stackoverflow.com/questions/10648681/how-to-enable-package-level-logging-in-log4j

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!