[logback-user] How to make RollingFileAppender roll even if no log events

Mads Bondo Dydensborg mbd at dbc.dk
Fri Aug 2 08:56:24 CEST 2013


Hi there

Not sure about the log situation, but why can't you just shut your app down, copy the log, and reboot the server?

Regards

Mads

Fredag 02 august 2013 00:50:21 skrev David Rosenstrauch:
> Hi.  We're trying to integrate the logback framework into our app, but 
> we're running into an issue with RollingFileAppender.
> 
> Our app is creating log files.  We are then using RollingFileAppender to 
> periodically roll the log file, gzip it, and move it to another 
> directory (where it subsequently gets pushed to another server for 
> processing).
> 
> This all works fine ... as long as there's logging events happening. 
> However, when there's no log events, the log file never rolls - which 
> prevents it from getting moved to the other directory, and getting 
> pushed to the other server.  So in effect, any data in the log file 
> stays there and never gets processed.
> 
> This takes on particular importance when we want to shut a server down. 
>   What should happen is that we stop sending the server traffic, wait 
> till the log file rolls, and then gets pushed to the processing server - 
> after which it's safe to shut the machine down and be assured of no log 
> data loss.
> 
> But when we stop sending the server traffic, logback stops rolling the 
> log too - resulting in a situation where the log data just sits in the 
> original log file and never gets rolled, pushed, and processed.  So 
> there's no safe time to shut the server down without loss of log data.
> 
> 
> Is there any way out of this situation?  I.e., any way to force logback 
> to do actual clock-based rolling, rather than event-based?
> 
> Thanks,
> 
> DR
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://mailman.qos.ch/mailman/listinfo/logback-user
> 
> 
> 
-- 
Med venlig hilsen/Regards

Chefarkitekt/Chief Architect cand.scient.dat, Ph.d., Mads Bondo Dydensborg
Dansk BiblioteksCenter A/S, Tempovej 7-11, 2750 Ballerup, Tlf. +45 29 84 00 42




More information about the Logback-user mailing list