[logback-user] RollingFile appender does not roll but copies files

Alex Greysukh agreysukh at certicasolutions.com
Fri Oct 15 19:17:56 CEST 2010

Hi Ceki,

Thank you very much for your advice.  I use a temporary file appender, and then reconnect to a permanent one after reading its parameters from DB. It looks like I did not disconnect temporary appender correctly and, as you have mentioned, I had 2 appenders operating on the same file.  Call to  root.detachAndStopAllAppenders() fixed the issue.


-----Original Message-----
From: logback-user-bounces at qos.ch [mailto:logback-user-bounces at qos.ch] On Behalf Of Ceki Gülcü
Sent: Wednesday, October 13, 2010 4:22 PM
To: logback users list
Subject: Re: [logback-user] RollingFile appender does not roll but copies files

Hello Alex,

I have read bug #=323609 with interest. If multiple RollingFileAppender 
instances open the same file in Windows, conflicts are bound to arise. 
I don't think logback is at fault here. Avoid having multiple 
RollingFileAppender instances opening the same file and the issue will 
go away.

If you register an OnConsoleStatusListener, you should see that 
RollingFileAppender is detecting the conflict and resorting to copying 
in order to prevent data loss.


[1] http://logback.qos.ch/manual/configuration.html#statusListener

On 13/10/2010 10:13 PM, Alex Greysukh wrote:
> I am in the process of porting from log4j to LogBack in Windows
> environment (logback-0.9.24, slf4j-1.6.1). Unfortunately, RollingFile
> appender does not roll but copies files (similar to what have been
> described in https://bugs.eclipse.org/bugs/show_bug.cgi?id=323609). Are
> there any near future plans to address the issue? Is there a temporary
> work around?(I configure logging programmatically). Any information or a
> hint is greatly appreciated.
> Alex Greysukh
Logback-user mailing list
Logback-user at qos.ch

More information about the Logback-user mailing list