8 Replies Latest reply on Apr 26, 2010 10:26 AM by Seamus Loftus

    Log4j and JBoss 4.2.3 not creating file.

    Seamus Loftus Newbie
      I am having some trouble with Log4J on JBoss 4.2.3 AS.  I know that JBoss has it's own log4j setup, but I am trying to keep my application independent from the rest of the project.  I set up class loading isolation as follows:

       

      {code}

      <

       

       

       

      jboss-web>

       

      <loader-repository>

      net.sourceforge.gateway:loader=GatewayLoader

       

      <loader-repository-config>

      java2ParentDelegation=false

       

      </loader-repository-config>

       

      </loader-repository>

      </

       

       

      jboss-web>

      {code}

       

      and here is my log4j file:

       

      {code}

      <?

       

      xml version="1.0" encoding="UTF-8" ?>

      <!

       

       

      DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

       

      <

       

      log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true">

       

      <appender name="console" class="org.apache.log4j.ConsoleAppender">

       

      <param name="Target" value="System.out" />

       

      <layout class="org.apache.log4j.PatternLayout">

       

      <param name="ConversionPattern" value="%-5p %c{1} - %m%n" />

       

      </layout>

       

      </appender>

       

       

      <appender name="appender" class="org.apache.log4j.FileAppender">

       

      <param name="File" value="gateway.log"/>

       

      <param name="Append" value="true"/>

       

      <layout class="org.apache.log4j.PatternLayout">

       

      <param name="ConversionPattern" value="%d [%t] %p - %m%n"/>

       

      </layout>

       

      </appender>

       

       

      <root>

       

      <appender-ref ref="appender"/>

       

      </root>

       

      </

       

      log4j:configuration>

      {code}

       

      My application still refuses to create the file gateway.log, but it prints out to the console.  Also, the log4j jar file is in the lib folder.