0 Replies Latest reply on Mar 13, 2006 6:39 PM by ddevore

    log4j problem with server.log.

    ddevore

      I have a problem with the server.log and getting output to not go to the server.log.

      I have looked at the wiki on logging and am trying to create an application.log and exception.log. I have setup the following.

       <!-- A time/date based rolling appender for application logs -->
       <appender name="Application" class="org.jboss.logging.appender.DailyRollingFileAppender">
       <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
       <param name="File" value="${jboss.server.home.dir}/log/Application.log"/>
       <param name="Append" value="false"/>
      
       <!-- Rollover at midnight each day -->
       <param name="DatePattern" value="'.'yyyy-MM-dd"/>
      
       <!-- Rollover at the top of each hour
       <param name="DatePattern" value="'.'yyyy-MM-dd-HH"/>
       -->
      
       <layout class="org.apache.log4j.PatternLayout">
       <!-- The default pattern: Date Priority [Category] Message\n -->
       <param name="ConversionPattern" value="%d %-5p [%t]: %m%n"/>
      
       <!-- The full pattern: Date MS Priority [Category] (Thread:NDC) Message\n
       <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
       -->
       </layout>
       </appender>
      


      and

       <!-- Limit the Application categories -->
       <category name="Application">
       <priority value="INFO"/>
       <appender-ref ref="Application"/>
       <appender-ref ref="CONSOLE"/>
       </category>
      


      and

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


      What this means to me is that an appender with the name application.log will be created and set to a log level of INFO rolling etc.... This appender will be associated with the application category and will write to the console but not the FILE appender which is the server.log. What happens is this:

      The application.log does not contain all the log entries and some of the logs are even incomplete such as only containing some of the log level only and not the log string. The log strings print to the console and print to the top of the server.log with a very large blank after it before the rest of the server log entries. If I write the categories as follows:

       <!-- Limit the Application categories -->
       <category name="Application">
       <priority value="INFO"/>
       <appender-ref ref="Application"/>
       </category>
      


      The logs are not printed to the console like I would like the application.log is printed better but the server.log is still getting all the log entries also with the same very large space after the log entries which should only be going to the application.log.

      Thanks for any help