Q:

log4j and Weblogic Server : Logs not getting generated

I have multiple ears,For certain Ears I want log4j details to be picked from Weblogic level and for certain application I have application level log4j.xml bundled with ear.

Copied wllog4j.jar and Log4j-x.x.x.jar to Server classpath
Added the following JAVA_OPTION in 

startWebLogic.sh -Dlog4j.Configuration=Mylog4j.xml

and add the "Mylog4j.xml" in the Server Classpath
as :
    SAVE_JAVA_OPTIONS="${JAVA_OPTIONS}" -Dlog4j.Configuration=Mylog4j.xml
    SAVE_CLASSPATH="${CLASSPATH}:/apps/myfiles/MyLog4j.xml" 

For application which have application level log4j.xml ,I have mentioned prefer-application-packages in weblogic-application.xml
<prefer-application-packages>
<package-name>org.apache.log4j.*</package-name> 
</prefer-application-packages>

But the logs are not getting generated for those application which has there log4j.xml
Also,Just for info : Applications are using slf4j/commons-logging and log4j
Please suggest !!!

A:

The issue was related to classloading : Below line in weblogic-applicaton.xml does the trick.
    <prefer-application-packages>
     <package-name>org.apache.log4j.*</package-name> 
     <package-name>org.apache.*</package-name> 
     <package-name>org.slf4j.*</package-name> 
    </prefer-application-packages>

