I am using log4j2 in a EAR application (WebLogic server), every call to log4j2 is wrapped by a class present in the lib ear directory therefore shared by all war and ejb. In this way all the loggers use a LoggerContext associated with a class loader that is a parent of the one that loads the war (the ClassLoaderContextSelector is responsible of this).
During redeploy/undeploy the LoggerContext is not shut down and the JMX bean is still there, because the Log4jServletContextListener only destroy the one associated with the servlet. It is a bug or should I close the LoggerContext explicitly? Maybe in some EJB lifecycle method? Apart from memory leak, are there any side effects in having multiple LoggerContext (leaked) that uses the same configuration file? We are also using OSB, and the loggig class are in domain/lib folder, therefore the class loader is unique across all applications in WebLogic, are there any drawbacks using this configuration? Thank you