Logging in common artifact

…衆ロ難τιáo~ 提交于 2019-12-24 08:29:19

问题


I am creating a common artifact that can be imported into different projects in my company. I have some debug logging statements (log4j) in my code.

My question is whether I should include a log4j dtd and xml in my jar, and what setting I need to have in the xml? I want the debug messages to be displayed only if the parent project enabled debug level, and the messages should go into the log file configured in that project.

Thanks.


回答1:


I'd use a wrapper like Simple Logging Facade for Java or Commons Logging in my artifact and let the integrator decide which logging tool to use and how to configure it.



来源:https://stackoverflow.com/questions/12378171/logging-in-common-artifact

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