[logback-user] Configuring SiftingAppender

Ceki Gülcü ceki at qos.ch
Mon May 3 14:27:22 CEST 2010


Hello Luciano,

You can't set the 30 minute threshold. However, you can force
immediate removal of nested FileAppender via SiftingAppender's
tracker.  Here is the code:

   SiftingAppende siftingAppender = ...
   AppenderTracer tracker = siftingAppender.getAppenderTracker();
   tracker.stopAndRemoveNow(aKey);

where 'aKey' is the discriminator value used for the nested FileAppender.

HTH,

On 03/05/2010 2:16 PM, Luciano Molinari wrote:
> Hi guys,
>
> I read the SiftingAppender's documentation and saw the following line:
> "...
> Appenders unused for 30 minutes will be automatically closed and discarded.
> ..."
>
> My question is if i can confiugure this time?
>
> I want to use SiftingAppender to create one file per "request", but one
> request can take some minutes to get finished and the whole system
> writes stuff about one particular request. It's such a trace log. As I
> can have lots of requests, i'm afraid of get a TooManyOpenFiles
> IOException during this 30 minutes interval. Does this fear proceed?
>
> Thanks and sorry for the english.
> --
> Luciano Davoglio Molinari
>
>


More information about the Logback-user mailing list