<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><div>After many attempts I can't print the log to a file.</div><div><br></div><div>- Result on STDOUT:</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">    </span><3-mar-2014 13.10.53 CET> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode></div><div><span class="Apple-tab-span" style="white-space:pre">      </span>0    [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] WARN  it.isp.swa.ProfiloSWA  - I love programming.</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>0    [[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'] ERROR it.isp.swa.ProfiloSWA  - I am programming.</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">       </span>The file MyLog.log is still not written.</div><div><br></div><div>- This is what I've done:</div><div><br></div><div>****************************</div><div>ListMan.ear</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>|</div><div><span class="Apple-tab-span" style="white-space:pre">    </span>-\META-INF</div><div><span class="Apple-tab-span" style="white-space:pre">           </span>|</div><div><span class="Apple-tab-span" style="white-space:pre">            </span>- weblogic-application.xml</div><div><span class="Apple-tab-span" style="white-space:pre">           </span>- logback.xml</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>- ConsoleAmministr.war</div><div><span class="Apple-tab-span" style="white-space:pre">               </span>|</div><div><span class="Apple-tab-span" style="white-space:pre">            </span>- \WEB-INF</div><div><span class="Apple-tab-span" style="white-space:pre">                   </span>|</div><div><span class="Apple-tab-span" style="white-space:pre">                    </span>weblogic.xml</div><div><span class="Apple-tab-span" style="white-space:pre">                 </span>logback.xml</div><div><span class="Apple-tab-span" style="white-space:pre">                  </span>|</div><div><span class="Apple-tab-span" style="white-space:pre">                    </span>- \lib</div><div><span class="Apple-tab-span" style="white-space:pre">                               </span>|</div><div><span class="Apple-tab-span" style="white-space:pre">                            </span>- logback-classic-1.1.1.jar</div><div><span class="Apple-tab-span" style="white-space:pre">                          </span>- logback-core-1.1.1.jar</div><div><span class="Apple-tab-span" style="white-space:pre">                             </span>- slf4j-api-1.7.6.jar</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>- \classes</div><div><span class="Apple-tab-span" style="white-space:pre">                           </span>|</div><div><span class="Apple-tab-span" style="white-space:pre">                            </span>logback.xml</div><div><span class="Apple-tab-span" style="white-space:pre">                          </span>- \it</div><div><span class="Apple-tab-span" style="white-space:pre">                                        </span>|</div><div><span class="Apple-tab-span" style="white-space:pre">                                    </span>- foo.java</div><div><span class="Apple-tab-span" style="white-space:pre">                           </span>- \resource</div><div><span class="Apple-tab-span" style="white-space:pre">                                  </span>|</div><div><span class="Apple-tab-span" style="white-space:pre">                                    </span>- logback.xml</div><div>***********************************************************</div><div>logback.xml:</div><div><br></div><div><?xml version="1.0" encoding="UTF-8"?></div><div><configuration></div><div><br></div><div><appender name="FILE" class="ch.qos.logback.core.FileAppender"></div><div><file>MyLog.log</file></div><div>    <encoder></div><div>      <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern></div><div>    </encoder></div><div> </appender></div><div>  </div><div>  <logger name="it" level="TRACE"/></div><div> </div><div>  <root level="debug"></div><div>    <appender-ref ref="FILE" /></div><div>  </root></div><div></configuration></div><div>***********************************************************</div><div>foo.java:</div><div>...</div><div>import org.slf4j.Logger;</div><div>import org.slf4j.LoggerFactory;</div><div>...</div><div><span class="Apple-tab-span" style="white-space:pre">     </span>static final Logger LOG = LoggerFactory.getLogger(foo.class);</div><div>...</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>LOG.info("I am fine.");</div><div><span class="Apple-tab-span" style="white-space:pre">    </span>LOG.warn("I love programming.");</div><div><span class="Apple-tab-span" style="white-space:pre">   </span>LOG.error("I am programming.");</div><div>...</div><div>***********************************************************</div><div>weblogic.xml:</div><div><br></div><div><?xml version="1.0" encoding="UTF-8"?></div><div><weblogic-web-app xmlns="http://xmlns.oracle.com/weblogic/weblogic-web-app" xmlns:j2ee="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd http://xmlns.oracle.com/weblogic/weblogic-web-app http://xmlns.oracle.com/weblogic/weblogic-web-app/1.2/weblogic-web-app.xsd"></div><div>  <jsp-descriptor></div><div>    <keepgenerated>true</keepgenerated></div><div>  </jsp-descriptor></div><div>  <context-root>/ConsoleAmministr</context-root></div><div>  <weblogic-version>10.3.5</weblogic-version></div><div>  <container-descriptor></div><div>  <span class="Apple-tab-span" style="white-space:pre">       </span><prefer-application-packages></div><div>    <span class="Apple-tab-span" style="white-space:pre">    </span><package-name>org.slf4j</package-name></div><div>  <span class="Apple-tab-span" style="white-space:pre">    </span></prefer-application-packages></div><div>  </container-descriptor></div><div></weblogic-web-app></div><div>***********************************************************</div><div>weblogic-application.xml:</div><div><br></div><div><?xml version="1.0" encoding="UTF-8"?></div><div><weblogic-application xmlns="http://www.bea.com/ns/weblogic/90"></div><div>    <prefer-application-packages></div><div>        <package-name>org.slf4j.*</package-name></div><div>        <package-name>antlr.*</package-name></div><div>    </prefer-application-packages></div><div>    </div><div>    <prefer-application-resources></div><div>        <resource-name>org/slf4j/impl/StaticLoggerBinder.class</resource-name></div><div>    </prefer-application-resources>    </div><div>    </div><div></weblogic-application></div><div>***********************************************************</div>                                      </div></body>
</html>