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 GOPALA KRISHNA PRABHU <GO...@nestec.net> on 2002/11/27 10:05:15 UTC

Is there any rolling of Log file by date/Number of Days ??

Dear Friend

How can I limit the logging of logs for the last 2 days only...
and the logs logged older than 2 days should be automatically cleared.

for example... 
using the following configuration I can log the latest 3KB data only...other
older logs are automatically Cleared.

log4j.rootLogger=DEBUG, A1
log4j.appender.A1=org.apache.log4j.RollingFileAppender
log4j.appender.A1.File=temp.txt
log4j.appender.A1.MaxFileSize=3KB
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%-4r %-5p -- %C- %m%n
log4j.logger.Log4jLogSample=info



Thanks in advance.
G.Gopala krishna Prabhu   
(gopalak@nestec.net)

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Is there any rolling of Log file by date/Number of Days ??

Posted by Fergus Gallagher <Fe...@OrbisUK.com>.
If you're on unix

	$ find $LOGDIR -mtime +2 | xargs rm -f

run as a cronjob.


On Wed, Nov 27, 2002 at 02:35:15PM +0530, GOPALA KRISHNA PRABHU wrote:
> Dear Friend
> 
> How can I limit the logging of logs for the last 2 days only...
> and the logs logged older than 2 days should be automatically cleared.
> 
> for example... 
> using the following configuration I can log the latest 3KB data only...other
> older logs are automatically Cleared.
> 
> log4j.rootLogger=DEBUG, A1
> log4j.appender.A1=org.apache.log4j.RollingFileAppender
> log4j.appender.A1.File=temp.txt
> log4j.appender.A1.MaxFileSize=3KB
> log4j.appender.A1.layout=org.apache.log4j.PatternLayout
> log4j.appender.A1.layout.ConversionPattern=%-4r %-5p -- %C- %m%n
> log4j.logger.Log4jLogSample=info
> 
> 
> 
> Thanks in advance.
> G.Gopala krishna Prabhu   
> (gopalak@nestec.net)
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

-- 
Fergus Gallagher          Tel: +44 (20) 8742 1600
Orbis                     Fax: +44 (20) 8742 2649
414 Chiswick High Street  email: Fergus.Gallagher@orbisuk.com
London  W4 5TL            Web: http://www.orbisuk.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>