logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralph Goers (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (LOG4J2-656) How to delete rolled over folder older than six months.
Date Mon, 02 Jun 2014 08:14:01 GMT

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

Ralph Goers edited comment on LOG4J2-656 at 6/2/14 8:12 AM:
------------------------------------------------------------

Every one here is a volunteer.  We all have day jobs that frequently prioritize what we can
work on, which may be completely unrelated to log4j.  If you need a feature or fix quickly
the best way to accomplish that is by providing a patch.

That said, the easiest way to delete files older than six months would be to write a corn
job that looks at the directory and does that cleanup by inspecting the file dates. 

At the moment Log4j does not have the ability to do what you are asking.  However, there has
been discussion on the mailing lists on how it could be enhanced to do this.  This issue should
be used to track the implementation of that enhancement.


was (Author: ralph.goers@dslextreme.com):
Every one here is a volunteer.  We all have day jobs that frequently prioritize what we can
work on, which may be completely unrelated to log4j.  If you need a feature or fix quickly
the best way to accomplish that is by providing a patch.

That said, the easiest way to delete files loser than six months would be to write a corn
job that looks at the directory and does that cleanup by inspecting the file dates. 

At the moment Log4j does not have the ability to do what you are asking.  However, there has
been discussion on the mailing lists on how it could be enhanced to do this.  This issue should
be used to track the implementation of that enhancement.

> How to delete rolled over folder older than six months.
> -------------------------------------------------------
>
>                 Key: LOG4J2-656
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-656
>             Project: Log4j 2
>          Issue Type: Question
>          Components: Appenders
>    Affects Versions: 2.0-rc1
>         Environment: Java 7
>            Reporter: sivan
>             Fix For: 2.0-rc1
>
>
> My application is using Rolling file appender. So the log files are daily rolled over
to the folder having name yyyy-MM. ie 2014-03, 2014-04, 2014-05 etc. Now the requirement is
to delete 6 months older folder from the path.
> Is there any configuration to achieve this?
> The current configuration is as below.
> <?xml version="1.0" encoding="UTF-8"?>
> <configuration>
> 	<properties>
> 		<property name="logPattern">%c|%K{sessionId}|%t|%d{MM/dd/yyyy HH:mm:ss.SSS}|%p|%C|%M|%L|%K{msg}%n</property>
> 		<property name="filePattern">${sys:logfilepath}//$${date:yyyy-MM}//${sys:oft.appserver}-out-%d{yyyy-MM-dd}.log</property>
> 		<property name="fileName">${sys:logfilepath}//${sys:oft.appserver}-out.log</property>
> 	</properties>
> 	<appenders>
> 		<Console name="Console" target="SYSTEM_OUT">
> 			<PatternLayout pattern="logPattern"/>
> 		</Console>
> 		<RollingFile name="RollingFile" fileName="${fileName}" filePattern="${filePattern}">
> 			<PatternLayout>
> 				<pattern>${logPattern}</pattern>
> 			</PatternLayout>
> 			<Policies>
> 				<TimeBasedTriggeringPolicy />
> 			</Policies>
> 		</RollingFile>
> 	</appenders>
> 	<loggers>
> 		<AsyncLogger name="logtype" level="info" includeLocation="true" additivity="false">
> 			<AppenderRef ref="RollingFile"/>
> 		</AsyncLogger>
> 		<root level="info">
> 			<AppenderRef ref="Console"/>
> 		</root>
> 	</loggers>
> </configuration>



--
This message was sent by Atlassian JIRA
(v6.2#6252)

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


Mime
View raw message