Logging in common artifact

2019-08-11 23:56发布

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.

标签: java log4j
1条回答
我欲成王,谁敢阻挡
2楼-- · 2019-08-12 00:24

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.

查看更多
登录 后发表回答