logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Curt Arnold <curt.arn...@comcast.net>
Subject Re: File appender that does not lock the file
Date Thu, 22 Nov 2007 22:10:42 GMT

On Nov 22, 2007, at 12:02 PM, sed wrote:

> Hi,
> Has log4j file append that does not lock file? So I can delete my to
> that log4j is writing logs and log4j will create file again.

I do not believe it would be possible to do so in platform  
independent manner.  On Unix's, I believe that "deleting" the file  
while log4j was logging would not cause any interruption, only the  
directory entry would be changed immediately and the file would be  
deleted when closed by log4j.  On WIndows, you'd either not be able  
to delete the file, but if you were able to delete the file then  
subsequent writes would fail and you could potentially recover as you  
suggest, but there is no mechanism to specify the locking behavior.

You might consider using ExternallyRolledFileAppender which will  
rename the current file when it receives a signal.

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

View raw message