0

I have application A.ear which includes a web application A.war. I have included the log4jAdmin.jsp in this war to control the logging levels dynamically at runtime for loggers used in this application. I also have deployed another appication B.ear in weblogic in the same server instance. This application too has its share of loggers defined in it's own log4j.xml file. How do I make the loggers of application B.ear visible in log4jAdmin.jsp page which is part of A.ear. I am using weblogic 9.2.

I know that according to classloader concepts, each application has its own classloader & the solution of moving log4j related files(jar and xml) to a common domain folder would have probably worked but for reasons beyond my control I cannot do this as A.ear which is a propietory application from Oracle(belongs to one of their Communication Suite of products) breaks down if I follow this route. B.ear is a custom applcation developed by me which contains plugins which are nothing but Enterprise beans invoked by A.ear.

So is there a way I can make loggers visible across all deployed applications so that using just one log4jAdmin.jsp I can change their logging levels? I know what I am trying to achieve really works because I noticed it is working in the latest version of A.ear which was released by Oracle for WL 10.3.3. The loggers defined for B.ear were visible in log4jAdmin.jsp page of A.ear. So I am wondering what needs to be done so that I acheive same results with WL 9.2.

Any help/hints would be greatly appreciated.

Thanks

skaffman
  • 398,947
  • 96
  • 818
  • 769
Avinash
  • 37
  • 2
  • 9

1 Answers1

0

I haven't worked with WebLogic, so my advice will be speculative, and of general nature.

Since class loading hierarchy scheme is defined by EJB specification, I'd try to deploy both log4j and its configuration as high in the hierarchy as possible. Most application servers have an 'extension' directory, where you can place jars visible by an extension classloader, which takes precedence over all web/ear classloaders. You could place the log4j.jar and (important!) log4j.xml there. It might be necessary to pack log4j.xml in a jar file (I don't know WL-specific details), as class loaders often look for jars only.

MaDa
  • 10,511
  • 9
  • 46
  • 84