logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mknott <MIKE_KN...@YAHOO.COM>
Subject log4j RollingFileAppender stops writing
Date Mon, 11 Oct 2010 19:44:15 GMT

>From time to time our log4j files stop writing with no error messages.  We
have configured our java-based application to write to these files and
rotate when they reach 20000KB, with 30 backups at a time using the
RollingFileAppender.  Using log4j 1.2.15, the server configuration is SunOS
5.10 Generic_141444-09 sun4v sparc SUNW,T5240.  The jvm is running perfectly
fine other than the logging.

I have noticed that writing sometimes stops if I do anything to look at the
data (i.e. tail, cat, vi, ...).  I don't think I'm locking the file while
it's rotating because the file size is not near the maxFileSize.

I have seen this topic on two other occasions but neither pointed to the
source of the problem or a follow-up by the person asking the question.

Below is our configuration file.  The main files I use is the <!-- ofbiz
file appender -->.  

$ cat log4j.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<!--
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  The ASF licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing,
  software distributed under the License is distributed on an
  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  KIND, either express or implied.  See the License for the
  specific language governing permissions and limitations
  under the License.
  -->

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

    <!-- async appender -->
    <appender name="async" class="org.apache.log4j.AsyncAppender">
        
        
        
        <!--appender-ref ref="stdout"/-->
        <appender-ref ref="ofbiz-file"/>
        <appender-ref ref="ofbiz-html"/>
        <!--appender-ref ref="debug"/>
        <appender-ref ref="error"/>
        <appender-ref ref="socket"/>
        <appender-ref ref="email"/-->
    </appender>

    <!-- stdout appender -->
    <appender name="stdout" class="org.apache.log4j.ConsoleAppender">
        
        <layout class="org.apache.log4j.PatternLayout">
            
        </layout>
    </appender>

    <!-- ofbiz file appender -->
    <appender name="ofbiz-file"
class="org.apache.log4j.RollingFileAppender">
        
        
        
        
        <layout class="org.apache.log4j.PatternLayout">
            
        </layout>
    </appender>

    <!-- ofbiz web file appender -->
    <appender name="ofbiz-html"
class="org.apache.log4j.RollingFileAppender">
        
        
        
        
        <layout class="org.apache.log4j.PatternLayout">
            
        </layout>
    </appender>

    <!-- debug log -->
    <appender name="debug" class="org.apache.log4j.RollingFileAppender">
        
        
        
        
        <layout class="org.apache.log4j.PatternLayout">
            
        </layout>
        <filter class="org.apache.log4j.varia.LevelRangeFilter">
            
            
            
        </filter>
    </appender>

    <!-- error log -->
    <appender name="error" class="org.apache.log4j.RollingFileAppender">
        
        
        
        
        <layout class="org.apache.log4j.PatternLayout">
            
        </layout>
        <filter class="org.apache.log4j.varia.LevelRangeFilter">
            
            
            
        </filter>
    </appender>

    <!-- special minerva log -->
    <appender name="minerva-log"
class="org.apache.log4j.RollingFileAppender">
        
        
        
        
        <layout class="org.apache.log4j.PatternLayout">
            
        </layout>
    </appender>

    <!-- chainsaw remote socket log monitor -->
    <appender name="socket" class="org.apache.log4j.net.SocketHubAppender">     
        
    </appender>

    <!-- fatal error SMTP notification -->
    <appender name="email"  class="org.apache.log4j.net.SMTPAppender">
        
        
        
        
          <!-- at least change this field! -->
        
        <layout class="org.apache.log4j.PatternLayout">
            
        </layout>
    </appender>

    <!-- special fop log -->
    <appender name="fop-log" class="org.apache.log4j.RollingFileAppender">
        
        
        
        
        <layout class="org.apache.log4j.PatternLayout">
            
        </layout>
    </appender>

    <!-- log4j category -->
    <category name="org.apache.log4j">
        <priority value="warn"/>
    </category>

    <!-- log minerva to the special log -->
    <category name="org.ofbiz.minerva">
        <priority value="warn"/>
        <appender-ref ref="minerva-log"/>
    </category>

    <!-- geronimo transaction logging -->
    <category name="org.apache.geronimo.transaction">
        <priority value="warn"/>
        <appender-ref ref="minerva-log"/>
    </category>

    <!-- fop rendering logging -->
    <category name="org.apache.fop">
        <priority value="info"/>
        <appender-ref ref="fop-log"/>
    </category>

    <!-- root logger -->
    <root>
        <priority value="all"></priority>
        <appender-ref ref="async"/>
    </root>
</log4j:configuration>

-- 
View this message in context: http://old.nabble.com/log4j-RollingFileAppender-stops-writing-tp29937281p29937281.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message