Sorry to hear that!

You are right that the docs currently don't mention the default value for
the max attribute.
We should fix the docs. Can I ask you to raise a Jira for this?

As for why not a large default value, there is a performance impact: all
files within the range need to be renamed (bump version by one), and the
current logic scans the directory to look for files that match the pattern.

You may be interested in the custom Delete action which is more efficient (
https://logging.apache.org/log4j/2.x/manual/appenders.html#CustomDeleteOnRollover
).


On Mon, Apr 10, 2017 at 2:50 PM, Chandra <
chandra.tungathur...@rwth-aachen.de> wrote:

> Hi guys,
>
> Something I noticed in my production, the maximum limit of index (i.e.,
> the max #files to be rolled before an overwrite occurs) is 7 by default.
> This is not mentioned anywhere in any of the documentation. I was only
> able to confirm this by actually looking into the source code [1].
> Unfortunately, by the time we noticed there was  huge data loss.
>
> I wanted to confirm:
> * Why is the default max index set to 7? I was naive to think that the
> default max index would be set to a large value (may be no max index at
> all, perhaps)
> * Why wasn’t this mentioned anywhere in the documentation (if it is, can
> you point me to it. may be I wasn’t paying attention). If it happened to
> me, perhaps it might for others.
>
>
>
> Best,
> Chandra
>
>
>
> [1] https://github.com/apache/logging-log4j2/blob/master/
> log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/
> DefaultRolloverStrategy.java#L126
>

Reply via email to