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 "Sanchez, Kenny J" <Ke...@gs.com> on 2006/03/22 18:16:52 UTC

File Size and Retention

 
Hello!!
 
How can I do the following:
 
I would like to create a log file and would like to SET THE FILE SIZE and
RETENTION period.
 
I would like to set the file size to 500KB and only save a weeks worth of
that file.  
 
Can someone point me in the right direction/send me an example???
 
Thanks,
 
Kenny
 

RE: File Size and Retention

Posted by Burton Strauss <Bu...@SmallNetSolutions.com>.
Check out the RollingFileAppender.
-----Burton 

-----Original Message-----
From: Sanchez, Kenny J [mailto:Kenny.Sanchez@gs.com] 
Sent: Wednesday, March 22, 2006 11:17 AM
To: 'log4j-user@logging.apache.org'
Subject: File Size and Retention
Importance: High

 
Hello!!
 
How can I do the following:
 
I would like to create a log file and would like to SET THE FILE SIZE and
RETENTION period.
 
I would like to set the file size to 500KB and only save a weeks worth of
that file.  
 
Can someone point me in the right direction/send me an example???
 
Thanks,
 
Kenny
 


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


RE: File Size and Retention

Posted by Ian King <is...@ntlworld.com>.
You could use the DailyRollingFileAppender with a DatePattern of '.'yyyy-w
where w is the week in year (see SimpleDateFormat).



-----Original Message-----
From: Sanchez, Kenny J [mailto:Kenny.Sanchez@gs.com] 
Sent: 22 March 2006 17:17
To: 'log4j-user@logging.apache.org'
Subject: File Size and Retention
Importance: High

 
Hello!!
 
How can I do the following:
 
I would like to create a log file and would like to SET THE FILE SIZE and
RETENTION period.
 
I would like to set the file size to 500KB and only save a weeks worth of
that file.  
 
Can someone point me in the right direction/send me an example???
 
Thanks,
 
Kenny
 


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