title: Using log4j in an ear under weblogic 12c
body: <p>I'm trying to configure log4j with slf4j to run under weblogic and manage the logs of an ear app with a web module and an ejb. While the web module prints the messages in the log file I configured, the ejb does not. It's like the ejb does not see the configuration file and does not initialize log4j.</p>
  
  <p>The ear has this structure:</p>
  
  <pre><code>--APP-INF
    --LIB
       --log4j-1.2.17.jar
       --slf4j-api-1.7.5.jar
       --slf4j-log4j12-1.7.5.jar
    --classes
      --log4j.xml
  --META-INF
  EJB.JAR
  WEB.WAR
  </code></pre>
  
  <p>And the configuration file (log4j.xml) in the APP-INF/classes folder of the ear:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;!DOCTYPE log4j:configuration PUBLIC
    "-//APACHE//DTD LOG4J 1.2//EN" "http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd"&gt;
  &lt;log4j:configuration debug="true"
      xmlns:log4j='http://jakarta.apache.org/log4j/'&gt;
  
          &lt;appender name="console" class="org.apache.log4j.ConsoleAppender"&gt;
              &lt;layout class="org.apache.log4j.PatternLayout"&gt;
                      &lt;param name="ConversionPattern" value="%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n" /&gt;
              &lt;/layout&gt;
      &lt;/appender&gt;
  
  
      &lt;appender name="file" class="org.apache.log4j.RollingFileAppender"&gt;
          &lt;param name="append" value="false" /&gt;
          &lt;param name="maxFileSize" value="1000KB" /&gt;
          &lt;param name="maxBackupIndex" value="5" /&gt;
          &lt;param name="file" value="/shared_ISILON_WLS/AppLogs/project/project.log" /&gt;
          &lt;layout class="org.apache.log4j.PatternLayout"&gt;
              &lt;param name="ConversionPattern" value="%d{dd-MM-yyyy HH:mm:ss} %-5p %c{1}:%L - %m%n" /&gt;
          &lt;/layout&gt;
      &lt;/appender&gt;
  
      &lt;appender name="fileSQL" class="org.apache.log4j.RollingFileAppender"&gt;
          &lt;param name="append" value="false" /&gt;
          &lt;param name="maxFileSize" value="1000KB" /&gt;
          &lt;param name="maxBackupIndex" value="5" /&gt;
          &lt;param name="file" value="/shared_ISILON_WLS/AppLogs/project/project_SQL.log" /&gt;
          &lt;layout class="org.apache.log4j.PatternLayout"&gt;
              &lt;param name="ConversionPattern" value="%d{dd-MM-yyyy HH:mm:ss} %-5p %c{1}:%L - %m%n" /&gt;
          &lt;/layout&gt;
      &lt;/appender&gt;
  
      &lt;logger name="es.project"&gt;
          &lt;level value="INFO" /&gt;
          &lt;appender-ref ref="file" /&gt;
      &lt;/logger&gt;
          &lt;logger name="org.primefaces"&gt;
              &lt;level value="INFO" /&gt;
              &lt;appender-ref ref="file" /&gt;
          &lt;/logger&gt;
      &lt;logger name="org.eclipse.persistence"&gt;
              &lt;level value="INFO"/&gt;
              &lt;appender-ref ref="fileSQL" /&gt;       
          &lt;/logger&gt;
  
  &lt;/log4j:configuration&gt;
  </code></pre>
  
  <p>From the documentation and other stackoverflow questions I checked, the configuration file has to be read from the ejb module right?
  I've also checked that there is no other configuration file inside the modules.
  It's there anything more to configure for the ejb module to see the configuration file?</p>