views:

124

answers:

2

Hi,

I'm deploying 2 ears in Weblogic 10, A and B. In both of them I have a "log4j.properties" file. At the startup, when the first ear is loading, the logs are to the right file "A.log", but when the second ear is loading, all logs are going to the "B.log" file, even logs related to the first ear. I missed something... any idea ?

Thanks

Edit/Solution : Classloader issue. Add to the weblogic-application.xml :

<wls:prefer-application-packages> <wls:package-name>org.apache.log4j.*</wls:package-name> </wls:prefer-application-packages>

Thks to everyone :)

A: 

Honestly it's hard to tell from here but you can try these:

1) check if the logger names in both of your log4j property files are unique.
2) I think that the .properties file are not cached on disk but still deleting the application deployment directories (should be separate for both the EAR's )

anuj singh
Logger names are unique. Cache is cleaned at every startup with a .bat
bob l'éponge est un con
+1  A: 

It would be my guess that the log4j library that is used by the Weblogic server is used in both your web applications.

If this is the case, both web apps would share a root classloader serving the global libraries loade by Weblogic.

If your web apps each provide a copy of log4j, and if you can choose to load the application classes before the server classes (I don't know Weblogic but for WebSphere the setting is 'classloader mode: parent first / parent last') that might solve your problem.

rsp
wls:prefer-application-packages is what you're looking for.
JoseK