Ok, I have some more time to work on this. > Though the tricky part is to find out what to delete.
I was just using anything that started with the 'prefix'. This doesn't seem too bad to me since if you want to delete old files, you just need to pick a good prefix. In my test case, I set the file format to have the minute and second in the file name. The rolling worked perfectly. > it is possible to use it to generate different directories for different > dates. This does put a damper on things. The valve could easily remember previous files, but files from previous executions would be forgotten, which doesn't seem right to me. Reliably getting a list of files to delete in all situations seems like a pretty complex task. However, if we force the idea of a good prefix selection, something similar could be done to what is in the patch code already, it would just have to be recursive. Then again, this is starting to have a few too many caveats. I had wondered about removing old files for a while, and had seen other people ask this as well, so I thought a simple solution might be possible. However, now I am rethinking this. Coming back to allowing the use of a standard logger. In my mini-benchmarks, it didn't seems like it made much of a difference time wise; the time spent in the logger took between 1-2 millis on my server. This seems like it would be dwarfed by the time to actually create and deliver the response. Still, maybe this is a problem that most people have solved their own way already and people don't want to have solved again. I don't want to make anything more complicated or harder to use. I can continue to work on this, but I am losing confidence that I can come up with something that will be worth of adoption. Comments? -----Original Message----- From: Konstantin Kolinko [mailto:knst.koli...@gmail.com] Sent: Thursday, March 29, 2012 4:44 PM To: Tomcat Developers List Subject: Re: AccessLogValve enhancement 2012/3/29 Mark Claassen <ma...@donnell.com>: > After thinking about this some more, and deliberating on the subtle > issues that were coming up, I decided to reduce the scope of my > enhancement. I still like the idea of using a standard logger for this > logging, but for now I thought I would focus more on my specific problem. I wrote more about this in the issue. > https://issues.apache.org/bugzilla/show_bug.cgi?id=52688 > > Is this something that could be adopted in a future 7.0 release? > To delete or otherwise rotate (move, compress, e-mail, etc.) old files - I think I would write a <Listener>, or set up a shell script in cron. When logger starts to write a new file it has to do so quickly, because it happens in a synchronized block. Deleting is possible, because it is a quick operation as well. Though the tricky part is to find out what to delete. The files are named by date and they are not created unless necessary. The date format is configurable. E.g. it is possible to use it to generate different directories for different dates. IIRC JRE's java.util.logging.FileHandler can be configured to keep n old files, but it uses different naming scheme. Best regards, Konstantin Kolinko --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org