0 Replies Latest reply on Mar 28, 2013 8:12 AM by petal1

    Using log4j in JBoss 6.0.0.Final

    petal1 Newbie

      Hello,

       

      I am migrating from JBoss 4.0.4.GA to JBoss 6.0.0.Final. Is it the case that log4j is no longer the logging mechanism used by default?

       

      If that is the case, how can I reinstate the same log4j functionality I had in 4.0.4?

       

      I see that I no longer have a log4j.xml file in server/myconfig/conf folder, and that a jboss-logging.xml file exists in server/myconfig/deploy folder.

       

      I was hoping that placing a log4j.xml file in the server/myconfig/conf folder might trigger JBoss into using log4j and the appenders defined therein - no such luck of course.

       

      Here is the log4j.xml file I placed in that folder in case it is relevant:

       

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

      <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

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

       

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

       

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

                <param name="ConversionPattern" value="[%d{dd/MM/yy hh:mm:ss:sss z}] %5p %c{2}: %m%n" />

            </layout>

       

                </appender>

       

                <appender name="FILE" class="org.apache.log4j.RollingFileAppender">

       

            <param name="File" value="${jboss.server.home.dir}/log/server.log" />

            <param name="MaxFileSize" value="20MB" />

            <param name="MaxBackupIndex" value="5" />

       

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

                <param name="ConversionPattern" value="[%d{dd/MM/yy hh:mm:ss:sss z}] %5p %c{2}: %m%n" />

           </layout>

       

                </appender>

       

                <root>

            <priority value="info" />

            <appender-ref ref="CONSOLE" />

            <appender-ref ref="FILE" />

                </root>

       

      </log4j:configuration>

       

       

      Thanks,

      Paul