Logback in java EAR applications
What is the best way to bundle logback in an ear application. The application encaspulates web applications (war files) and ejb modules? By having the logback.xml in the web application I only get logs from that application but not from the ejb modules. Is theer some bes开发者_Python百科t practices for this scenarios?
Thanks.
I agree. Also, you may package this special jar packaged inside ear's lib directory exploded. This way, you may change this file easily.
Note: If you plan to change the logback.xml files dynamically without the need to redeploy, you may insert scan="true" in logback.xml
It's best to keep it in one of the jars inside an ear. Ideally, you could have a special jar for internal configuration — your properties, Spring metadata (if any), etc.; that would be a perfect place to keep logback.xml
as well.
Same goes for the logback library, too — it should be shared, it's easier to manage it like that.
精彩评论