logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Schaft (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-435) Feature request: auto-delete older log files
Date Thu, 26 Nov 2015 12:59:13 GMT

    [ https://issues.apache.org/jira/browse/LOG4J2-435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15028708#comment-15028708

Robert Schaft commented on LOG4J2-435:

I know cron. But I have also problems defining a good interval.

I need the feature of log file archive clean up, because we have to support systems running
over years. It happened, that the log files filled the disk. Sometimes in a couple of hours
because someone enabled a DEBUG or TRACE loglevel.

The full disk created again problems for other processes and the system behaved strangely.
I want to avoid this. I want to provide a robust system where you need to do at least two
wrong settings to cause serious problems.

So what is the recommended cron cycle? Once per day? A harddisk could be full by that time.
Once per hour? It's harder to fill the disk in that time. On the other hand the space estimated
for the log files is normally only around a gigabyte. It could be filled in some seconds.
That is why I ended up saying that the script needs to run every second. Sounds insane, but
is the only strategy for me to provide a robust system using a cron job.

I don't have those problems with trigger based clean up. That's why I like them.

> Feature request: auto-delete older log files 
> ---------------------------------------------
>                 Key: LOG4J2-435
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-435
>             Project: Log4j 2
>          Issue Type: Improvement
>            Reporter: Arkin Yetis
>            Assignee: Remko Popma
>              Labels: Rollover
>             Fix For: 2.5
>         Attachments: LimitingRolloverStrategy.java, SizeParser.java
> Original description:
> {quote}
> DefaultRolloverStrategy max attribute only applies if you have a %i in the file pattern.
This request is to enhance DefaultRolloverStrategy or another appropriate component to allow
a max number of files limit to apply across days/months/years when a filePattern includes
a date pattern.
> {quote}
> ----
> One of the most requested features is to add the ability to Log4j to "clean up" older
log files.  This usually means deleting these files, although it could also mean moving them
to a different location, or some combination of these. 
> Users have different requirements for selecting the files to clean up. A common request
is the ability to keep the last X number of log files. This works well if rollover is only
date based but may give undesired results with size based rollover. 
> Another factor to consider is that the directory containing the log files may contain
the log files for multiple appenders, or even files unrelated to logging. 

This message was sent by Atlassian JIRA

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

View raw message