2 Replies Latest reply on Jun 28, 2012 11:02 AM by António Ribeiro

    Log4j configuration

    rajasekharba Newbie

      Hi,

       

      I have added following appender to the jboss-log4j.xml and calling logger like below and getting error message. No log4j.jar included in code or libarary

       

      Error message :

      15:15:30,000 ERROR [STDERR] log4j:ERROR A "org.jboss.logging.appender.FileAppender" object is not assignable to a "org.apache.log4j.Appender" variable.

      15:15:30,000 ERROR [STDERR] log4j:ERROR The class "org.apache.log4j.Appender" was loaded by

      15:15:30,000 ERROR [STDERR] log4j:ERROR [BaseClassLoader@1116f9{vfszip:/C:/jboss-eap-5.1/jboss-as/server/default/deploy/abc.ear/}] whereas object of type

      15:15:30,000 ERROR [STDERR] log4j:ERROR "org.jboss.logging.appender.FileAppender" was loaded by [org.jboss.bootstrap.NoAnnotationURLClassLoader@19616c7].

      15:15:30,000 ERROR [STDERR] log4j:ERROR Could not instantiate appender named "FILE".

       

      Jboss-log4j.xml - appender

      -------------------------------------

      <appender name="SLppender" class="org.jboss.logging.appender.RollingFileAppender">  
           <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>    
           <param name="File" value="${jboss.server.log.dir}/sl/abc.log"/>  
           <param name="Append" value="false"/>  
           <param name="MaxFileSize" value="50MB"/>
           <param name="MaxBackupIndex" value="10"/>
           <layout class="org.apache.log4j.PatternLayout">       
           <param name="ConversionPattern" value="%d %-5p [%c] (%t:%x) %m%n"/>    
           </layout>
            <filter class="org.jboss.logging.filter.TCLFilter">
            <param name="AcceptOnMatch" value="true"/>
            <param name="DeployURL" value="abc.ear"/>
           </filter>   
           <filter class="org.apache.log4j.varia.DenyAllFilter"></filter> 
         </appender>
        
        Code :

      ---------

      import org.apache.log4j.Logger;

       

      public class ab {

      private static Logger logger = Logger.getLogger(ab.class.getName()); 

       

      -------------

      ----------

      }

       

      can you please help me ,how to reslove?

       

      Thanks,

      Raj