logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shane Baker <sba...@xtier.com>
Subject RE: File system full causes log4cxx to crash
Date Sat, 20 Sep 2008 18:17:15 GMT
I have a couple of comments:

1.  The RollingFileAppender allows you to know a priori exactly how much 
disk space is required.  Is there an amount of space you can be sure will 
exist?  Worst case, if you own the environment, you could create a 
partition and log there.
2.  I think a default behavior of deleting the oldest logs in this 
situation would be a bad idea - stop logging would be better.  A disk full 
situation may be the result of an application error or some kind of DoS 
attack, the details of which might be logged and subsequently lost if the 
oldest logs are deleted.  This behavior seems like it could be 
configurable but, by default, I would not delete existing logs.

These aren't the comments you're looking for, I'm sure, but I have never 
run into this problem before so I cannot provide a real solution.

You didn't mention how it is that you know that log4cxx is the cause of 
the crash.  Is the crash from any log write when the volume is full, or 
does it happen when the log attempts to roll?  You didn't mention what 
Unix and version you are using.  This would be helpful to attempt to 

Sorry I can't be more help to your particular problem, but I wanted to 
weigh in on the possible solution implementation.

On Sat, 20 Sep 2008, Peter Steele wrote:

> Does not one have any comments on this? Surely someone must have
> experienced this scenario, specially the volume where logs are being
> recorded becoming filled up.
> From: Peter Steele [mailto:psteele@maxiscale.com]
> Sent: Friday, September 19, 2008 11:46 AM
> To: Log4CXX User
> Subject: File system full causes log4cxx to crash
> We've experienced several cases of our logging volume becoming full
> during the course of execution of our application. What we would like to
> happen in this case is simply to lose any log further messages that are
> written after the file system becomes full, but what happens instead is
> log4cxx crashes and brings down our application. We're using the
> RollingFileAppender on a Unix box. Is there some way to configure
> log4cxx to behave a little less drastically in a case like this?
> Ideally, the best behavior in a case like this would be for log4cxx to
> delete the oldest backup log file and continue logging, but even simply
> suspending logging would be better than a crash. Any suggestions?

View raw message