You don't have to manage your disk space from within log4j. To conserve hard-drive space, you can use classes in the java.util.zip package to zip up your log files. You can schedule a nightly batch job that kicks off a Java class that uses java.util.zip. The book "Java i/O" by O'Reilly gives excellent coverage of the subject (along with the classes in package java.io). The Java class can also look at the dates of your zip files and delete files greater than x days old.

I hope this helps.

Bob


At 03:56 PM 04/28/2004 -0700, you wrote:
I have to have per-client logfiles for my environment.  We have about
100 concurrent users so I am going to have RollingFileAppenders for each
logger.  My problem is going to be disk space.  Some of the clients will
do a lot of logging, others will be very sparse.  My fear is that I
won't be able to use the maxFiles and fileSize values to make sure the
logs don't use too much space.  Assuming all clients will log heavily
and capping the maxFiles and fileSize accordingly will be prohibitively
sub-optimal.  Any other usage of those 2 values to limit log
proliferation is inherently dangerous.

I was wondering whether anyone else has had this problem and how they
fixed it.  My current plan is to subclass RollingFileAppender and have
it delete the last touched file when the total log-space-used gets above
a certain size.  After a while, this will entail the overhead of finding
which is the oldest log-file (in order to delete it) every time a new
file is created.

Does anyone have a better idea?

alan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Bob Pepersack 410-468-2054


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to