multiple applications with multiple log4j.xml in weblogic

纵饮孤独 提交于 2019-12-10 10:14:31

问题


I deploy multiple applications (ear) in one domain on a Weblogic-Server. Each application uses log4j. My wish is to configure each applications with its own log4j.xml. Is this possible? The log4j.xml should be outside of the ear, so that I can edit it without rebuilding the ear.

I'm used to put the log4j.xml in the serverclasspath, then it is read on server startup. But then I don't have the possibility to use different log4j.xml for each application.

I think it is a classpath issue, because log4j search for the log4j.xml in the classpath. But I don't know, how to uses different classpath for different applications.


回答1:


I don't think its possible to have different log4j.xml files for different applications deployed on the same WebLogic server unless the log4j.xml files are packaged with ear itself.

So, may be you can have different loggers for different applications? That way same log4j.xml can be used by different applications but the logger definitions the applications use can differ.




回答2:


Um, sure it is possible, if you configure the log4j by yourself from different files (such as log4j-app1.xml and log4j-app2.xml). You could have a configuring servlet per app. See details in this other post I made.

However, having them all in a one file, like already proposed here, is something I would also recommend.



来源:https://stackoverflow.com/questions/13140393/multiple-applications-with-multiple-log4j-xml-in-weblogic

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