3 Replies Latest reply on Dec 26, 2007 4:56 PM by John Eric Hamacher

    trouble with log4j configuration in app server.

    John Eric Hamacher Newbie

      Hello:

      I get the following errors when I start up jBoss (4.2.1.GA):
      -------------------------------------------------


      ERROR [STDERR] log4j:ERROR A "org.jboss.logging.appender.FileAppend
      er" object is not assignable to a "org.apache.log4j.Appender" variable.

      ERROR [STDERR] log4j:ERROR Could not instantiate appender named "FILE".



      My jboss-log4j.xml file is as follows:
      -----------------------------------

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
      <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
















      <param name="DatePattern" value="'.'yyyy-MM-dd"/>











      <!-- The default pattern: Date Priority [Category] Message\n -->


















      <appender-ref ref="HVGN"/>







      <appender-ref ref="CONSOLE"/>
      <appender-ref ref="FILE"/>


      </log4j:configuration>


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

      The log file for the HVGN appender is created but nothing is written to it when "duke" and descendant package class files issue log
      statements. In addition, despite the error with the FILE appender,
      content is still written to server.log. I don't see an error in my jboss-log4j.xml file. I tried to substitue in
      "jboss.logging.appender" for the class attributes in the appenders, but I get the same errors.

      Anybody got any ideas?

        • 1. Re: trouble with log4j configuration in app server.
          John Eric Hamacher Newbie

          Let's try that again . . .

          Hello:

          I get the following errors when I start up jBoss (4.2.1.GA):
          -------------------------------------------------


          ERROR [STDERR] log4j:ERROR A "org.jboss.logging.appender.FileAppend
          er" object is not assignable to a "org.apache.log4j.Appender" variable.

          ERROR [STDERR] log4j:ERROR Could not instantiate appender named "FILE".



          My jboss-log4j.xml file is as follows:
          -----------------------------------

          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
          <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
















          <param name="DatePattern" value="'.'yyyy-MM-dd"/>





























          <appender-ref ref="HVGN"/>







          <appender-ref ref="CONSOLE"/>
          <appender-ref ref="FILE"/>


          -->

          </log4j:configuration>


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

          The log file for the HVGN appender is created but nothing is written to it when "duke" and descendant package class files issue log
          statements. In addition, despite the error with the FILE appender,
          content is still written to server.log. I don't see an error in my jboss-log4j.xml file. I tried to substitue in
          "jboss.logging.appender" for the class attributes in the appenders, but I get the same errors.

          Anybody got any ideas?

          • 2. Re: trouble with log4j configuration in app server.
            John Eric Hamacher Newbie

            OK, why is my code invisible? I disabled HTML.

            • 3. Re: trouble with log4j configuration in app server.
              John Eric Hamacher Newbie

              OK, finally . . .

              Hello:

              I get the following errors when I start up jBoss (4.2.1.GA):
              -------------------------------------------------


              ERROR [STDERR] log4j:ERROR A "org.jboss.logging.appender.FileAppend
              er" object is not assignable to a "org.apache.log4j.Appender" variable.

              ERROR [STDERR] log4j:ERROR Could not instantiate appender named "FILE".



              My jboss-log4j.xml file is as follows:
              -----------------------------------

              <?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="HVGN" class="org.apache.log4j.RollingFileAppender">
               <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
               <param name="File" value="c:/jboss-4.2.1.GA/server/hvgn/log/hvgn.log"/>
               <param name="Append" value="false"/>
               <param name="MaxFileSize" value="500KB"/>
               <param name="MaxBackupIndex" value="3"/>
               <layout class="org.apache.log4j.PatternLayout">
               <param name="ConversionPattern" value="%d{dd MMM yyyy HH:mm:ss} - [%c{1}.%M] - %p - %m%n"/>
               </layout>
               </appender>
              
               <appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
               <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
               <param name="File" value="c:/jboss-4.2.1.GA/server/hvgn/log/server.log"/>
               <param name="Append" value="false"/>
               <param name="DatePattern" value="'.'yyyy-MM-dd"/>
               <layout class="org.apache.log4j.PatternLayout">
               <param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
               </layout>
               </appender>
              
               <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
               <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
               <param name="Target" value="System.out"/>
               <param name="Threshold" value="INFO"/>
              
               <layout class="org.apache.log4j.PatternLayout">
               <!-- The default pattern: Date Priority [Category] Message\n -->
               <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
               </layout>
               </appender>
              
               <category name="org.apache">
               <priority value="INFO"/>
               </category>
              
               <category name="org.jboss.serial">
               <priority value="INFO"/>
               </category>
              
               <category name="org.jgroups">
               <priority value="WARN"/>
               </category>
              
               <category name="duke">
               <priority value="DEBUG"/>
               <appender-ref ref="HVGN"/>
               </category>
              
               <category name="org.jboss.management">
               <priority value="INFO"/>
               </category>
              
               <root>
               <appender-ref ref="CONSOLE"/>
               <appender-ref ref="FILE"/>
               </root>
              </log4j:configuration>



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

              The log file for the HVGN appender is created but nothing is written to it when "duke" and descendant package class files issue log
              statements. In addition, despite the error with the FILE appender,
              content is still written to server.log. I don't see an error in my jboss-log4j.xml file. I tried to substitue in
              "jboss.logging.appender" for the class attributes in the appenders, but I get the same errors.

              Anybody got any ideas?