File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Open Source Projects and the fly likes DailyRollingFileAppender backup Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Reply Bookmark "DailyRollingFileAppender backup" Watch "DailyRollingFileAppender backup" New topic
Author

DailyRollingFileAppender backup

kamesh aru
Ranch Hand

Joined: Mar 16, 2002
Posts: 150
is there a way to set number of days the log files will backed up daily like 15 days or 30 days then over write the old files

org.apache.log4j.DailyRollingFileAppender
thanks in advance
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 32769
The files wouldn't get overwritten, since they all have different names. Do you mean deleting them after a certain period? I don't think there is a way to do this. You could roll your own by extending DailyRollingFileAppender, and add an additional parameter to that effect. Or create a background thread that cleans up periodically (I wouldn't delete log files, though, but zip then up and store them someplace else).


Android appsImageJ pluginsJava web charts
kamesh aru
Ranch Hand

Joined: Mar 16, 2002
Posts: 150
create a background thread that cleans up periodically (I wouldn't delete log files, though, but zip then up and store them someplace else).
yes i mean to clean up the directory periodically .
is there a way log4j does this or we need to write code for this ?
thanks for the reply
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 32769
Cleaning up the directory has nothing to do with logging directly, and log4j will not help you there.
You'll need to write some code that starts a thread which executes once a week or once a month, and which then deletes whatever files you want to get rid of.
kamesh aru
Ranch Hand

Joined: Mar 16, 2002
Posts: 150
thanks for the reply
 
IntelliJ Java IDE
 
subject: DailyRollingFileAppender backup
 
Threads others viewed
how to get the list of changed files in a timeframe by CVS command?
CVS - Find files modified in past 10 days
i want to play wav audio files in java
simple project ideas
.CFM Files
IntelliJ Java IDE