简体   繁体   中英

Logging in maven multimodule project

I have a maven multimodule project. Its modules are like core module (DAO layer), service module, web services module, and web module. Now I want to implement logback logging in my project. How should I configure it?

Do i need to configure logback in every module which means separate logback.xml in every module or is there any way to configure it at one place and every module uses that configuration?

Also, is there any way to keep some of my modules independent of any specific logging implementation which means they will keep logging even if in future I change my logging implementation from logback to log4j?

Also, please suggest best practices/industry standards followed..

Do i need to configure logback in every module which means separate logback.xml in every module or is there any way to configure it at one place and every module uses that configuration?

No just once in the web should do.

Also, is there any way to keep some of my modules independent of any specific logging implementation which means they will keep logging even if in future I change my logging implementation from logback to log4j?

Try slf4j http://www.slf4j.org/ You can hook up a logback/log4j/java.util.logging implementation to that façade

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM