You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Mariano Gonzalez <ma...@gmail.com> on 2014/07/30 21:30:57 UTC

DefaultRolloeverStrategy

Hello,

I'm configuring a RollingFileAppender programatically, using a
TimeBasedTriggeringPolicy in tandem with a DefaultRooloverStrategy. So far
so good, but is there a way to provide a RolloeverStrategy which renames
the files but never deletes them?

Thanks!

Re: DefaultRolloeverStrategy

Posted by Ralph Goers <rg...@apache.org>.
No, it does not matter.

Sent from my iPad

> On Jul 31, 2014, at 7:31 AM, Mariano Gonzalez <ma...@gmail.com> wrote:
> 
> Thank you Remko and Ralph! That clarifies a lot. Then I have to ask, if my
> pattern only contains a %d, what value should I use as max value? Does it
> matter at all?
> 
> Thanks!
> 
> 
>> On Wed, Jul 30, 2014 at 8:23 PM, Remko Popma <re...@gmail.com> wrote:
>> 
>> I stand corrected. Thanks, Ralph!
>> 
>> Sent from my iPhone
>> 
>>> On 2014/07/31, at 8:14, Ralph Goers <ra...@dslextreme.com> wrote:
>>> 
>>> Remko, that is not exactly correct.  If you specify %i in the
>> filePattern once the max value is hit the oldest file that matches the
>> complete pattern will be deleted automatically.  The issue you are speaking
>> of is that when the pattern includes a date via %d we will not delete files
>> from previous dates.
>>> 
>>> If the pattern only contains %d and does not contain %i then the files
>> will never be deleted by Log4j.
>>> 
>>> Ralph
>>> 
>>> 
>>>> On Jul 30, 2014, at 3:44 PM, Remko Popma <re...@gmail.com> wrote:
>>>> 
>>>> The built-in rollover only moves/renames but never deletes files. (We
>> actually have outstanding enhancement request to add some auto-delete
>> function.)
>>>> 
>>>> Sent from my iPhone
>>>> 
>>>>> On 2014/07/31, at 4:30, Mariano Gonzalez <ma...@gmail.com>
>> wrote:
>>>>> 
>>>>> Hello,
>>>>> 
>>>>> I'm configuring a RollingFileAppender programatically, using a
>>>>> TimeBasedTriggeringPolicy in tandem with a DefaultRooloverStrategy. So
>> far
>>>>> so good, but is there a way to provide a RolloeverStrategy which
>> renames
>>>>> the files but never deletes them?
>>>>> 
>>>>> Thanks!
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>>>> For additional commands, e-mail: log4j-user-help@logging.apache.org
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>>> For additional commands, e-mail: log4j-user-help@logging.apache.org
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-user-help@logging.apache.org
>> 
>> 

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


Re: DefaultRolloeverStrategy

Posted by Mariano Gonzalez <ma...@gmail.com>.
Thank you Remko and Ralph! That clarifies a lot. Then I have to ask, if my
pattern only contains a %d, what value should I use as max value? Does it
matter at all?

Thanks!


On Wed, Jul 30, 2014 at 8:23 PM, Remko Popma <re...@gmail.com> wrote:

> I stand corrected. Thanks, Ralph!
>
> Sent from my iPhone
>
> > On 2014/07/31, at 8:14, Ralph Goers <ra...@dslextreme.com> wrote:
> >
> > Remko, that is not exactly correct.  If you specify %i in the
> filePattern once the max value is hit the oldest file that matches the
> complete pattern will be deleted automatically.  The issue you are speaking
> of is that when the pattern includes a date via %d we will not delete files
> from previous dates.
> >
> > If the pattern only contains %d and does not contain %i then the files
> will never be deleted by Log4j.
> >
> > Ralph
> >
> >
> >> On Jul 30, 2014, at 3:44 PM, Remko Popma <re...@gmail.com> wrote:
> >>
> >> The built-in rollover only moves/renames but never deletes files. (We
> actually have outstanding enhancement request to add some auto-delete
> function.)
> >>
> >> Sent from my iPhone
> >>
> >>> On 2014/07/31, at 4:30, Mariano Gonzalez <ma...@gmail.com>
> wrote:
> >>>
> >>> Hello,
> >>>
> >>> I'm configuring a RollingFileAppender programatically, using a
> >>> TimeBasedTriggeringPolicy in tandem with a DefaultRooloverStrategy. So
> far
> >>> so good, but is there a way to provide a RolloeverStrategy which
> renames
> >>> the files but never deletes them?
> >>>
> >>> Thanks!
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> >> For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> > For additional commands, e-mail: log4j-user-help@logging.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

Re: DefaultRolloeverStrategy

Posted by Remko Popma <re...@gmail.com>.
I stand corrected. Thanks, Ralph!

Sent from my iPhone

> On 2014/07/31, at 8:14, Ralph Goers <ra...@dslextreme.com> wrote:
> 
> Remko, that is not exactly correct.  If you specify %i in the filePattern once the max value is hit the oldest file that matches the complete pattern will be deleted automatically.  The issue you are speaking of is that when the pattern includes a date via %d we will not delete files from previous dates. 
> 
> If the pattern only contains %d and does not contain %i then the files will never be deleted by Log4j.
> 
> Ralph
> 
> 
>> On Jul 30, 2014, at 3:44 PM, Remko Popma <re...@gmail.com> wrote:
>> 
>> The built-in rollover only moves/renames but never deletes files. (We actually have outstanding enhancement request to add some auto-delete function.)
>> 
>> Sent from my iPhone
>> 
>>> On 2014/07/31, at 4:30, Mariano Gonzalez <ma...@gmail.com> wrote:
>>> 
>>> Hello,
>>> 
>>> I'm configuring a RollingFileAppender programatically, using a
>>> TimeBasedTriggeringPolicy in tandem with a DefaultRooloverStrategy. So far
>>> so good, but is there a way to provide a RolloeverStrategy which renames
>>> the files but never deletes them?
>>> 
>>> Thanks!
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 

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


Re: DefaultRolloeverStrategy

Posted by Ralph Goers <ra...@dslextreme.com>.
Remko, that is not exactly correct.  If you specify %i in the filePattern once the max value is hit the oldest file that matches the complete pattern will be deleted automatically.  The issue you are speaking of is that when the pattern includes a date via %d we will not delete files from previous dates. 

If the pattern only contains %d and does not contain %i then the files will never be deleted by Log4j.

Ralph


On Jul 30, 2014, at 3:44 PM, Remko Popma <re...@gmail.com> wrote:

> The built-in rollover only moves/renames but never deletes files. (We actually have outstanding enhancement request to add some auto-delete function.)
> 
> Sent from my iPhone
> 
>> On 2014/07/31, at 4:30, Mariano Gonzalez <ma...@gmail.com> wrote:
>> 
>> Hello,
>> 
>> I'm configuring a RollingFileAppender programatically, using a
>> TimeBasedTriggeringPolicy in tandem with a DefaultRooloverStrategy. So far
>> so good, but is there a way to provide a RolloeverStrategy which renames
>> the files but never deletes them?
>> 
>> Thanks!
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 


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


Re: DefaultRolloeverStrategy

Posted by Remko Popma <re...@gmail.com>.
The built-in rollover only moves/renames but never deletes files. (We actually have outstanding enhancement request to add some auto-delete function.)

Sent from my iPhone

> On 2014/07/31, at 4:30, Mariano Gonzalez <ma...@gmail.com> wrote:
> 
> Hello,
> 
> I'm configuring a RollingFileAppender programatically, using a
> TimeBasedTriggeringPolicy in tandem with a DefaultRooloverStrategy. So far
> so good, but is there a way to provide a RolloeverStrategy which renames
> the files but never deletes them?
> 
> Thanks!

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