We have following Set up:
Application Server : Weblogic 10.3.6
We have 2 Managed Servers and we have 3 web applications wars deployed on both the managed servers. All log4j2 jars are kept in server lib and loaded on server start up.
Now we want each web application to have its own logj2 configuration as we want to have control on logs levels.
we made separate log4j2 configuration file for each web application using tried initialising same using log4j2-web.jar in web.xml but we observed that when we load first web application, the log4j2 configuration file get loaded but when we try to load 2nd and 3rd web application,with their separate log4j config xmls,it doesnt load the new config file but sets log4j2 configurations of first web applications which got deployed first.
I tried to debug same and got to the point that as log4j2 jars are present in server class loader so they are common to all web application and log4j2 uses class loader to load logger context.
Now i want each application to have its separate log4j2 implementation which will not be common to other web application.so logging will be different for each application.
Kindly note, i cannot copy log4j2 libraries in WEB-INF/lib of each web applications as we already have size constrain for war.
Kindly suggest how can i implement separate log4j2 configuration for each web application in single weblogic container.
I tried to use JNDIContextSelector but its not working in Weblogic or i dont know how to make it work in weblogic as after doing all the required changes mentioned in log4j2 website,it was not able to find loggers.
Kindly help as i m stuck in same issue from last week.