1 Reply Latest reply on Nov 5, 2014 12:35 PM by Wolf-Dieter Fink

    How can i specify a LoggerFactory?

    Carol Contello Newbie

      Hi,

       

      i'm upgrading a project from jboss4 to AS 7.3.0.Final. When configuring the logging, i use log4j and in jboss 4 i was able to specify a logger factory in the configuration file. This is a snippet of the code:

       

      <?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">

          <param name="Threshold" value="INFO"/>

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

       

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

            <param name="ConversionPattern" value="%d %x %-4p [%c{1}] %m%n"/>

          </layout>

        </appender>

       

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

          <errorHandler class="org.apache.log4j.helpers.OnlyOnceErrorHandler"/>

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

          <param name="File"           value="${catalina.base}/logs/sql.log"/>

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

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

          <param name="Threshold"      value="TRACE"/>

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

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

          </layout>

        </appender>

       

         <logger name="com.xxxx.xxx.xxxxx.MyClass" additivity="false">

          <level value="DEBUG"/>

          <appender-ref ref="SQL"/>

        </logger>

       

        <root>

          <appender-ref ref="CONSOLE"/>

        </root>

       

      <loggerFactory class="com.xxxx.logger.MyLog4JLoggerFactory"/>

      </log4j:configuration>

       

      Now that i'm trying to upgrade to jboss7, i'm configuring the logging subsytem in the standalone.xml following the documentation but i don't see the loggerFactory supported here. Is this feature available or is there any workaround to define it?

       

      Any help would be really appreciated.