I do a very similar things on OpenVMS all the time; Showing at the log data using $ TYPE <log filename> does never disturbed the logger and appender from further logging. However, I can never ever take any editor to catch and edit a file while it is currently "LOCKED BY ANOTHER USER"! This would immediately be honored by the file system with the error message "FILE CURRENTLY LOCKED BY ANOTHER USER"
--- To say; if your OS allows for a real CLEAN shared read access, and your file writer your appender does not lock the file for explicit read + write access which would prevent a shared read access by another process, the CAT should work. But what if CAT demands i.e. an explicit read access and lock the file? this would prevent your JVM to continue to log. Question to developers: how does the appender lock the log file on LINUX, UNIX, WINDOWS, OS2, .... If your File system does not detect that a given log file is currently locked by another user and allows as you say i.e. VI or any other editor to access it, then a locking-problem is every likely to occur. Josef -----Ursprüngliche Nachricht----- Von: mknott [mailto:[email protected]] Gesendet: Montag, 11. Oktober 2010 21:44 An: [email protected] Betreff: log4j RollingFileAppender stops writing >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: [email protected] For additional commands, e-mail: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
