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 Colin MacDonald <co...@templarcorp.com> on 2002/07/31 22:24:38 UTC

RollingFileAppender disk full handling

Hi all!  In my application, I need to know if log4j failed to write a log
message.

I'm using RollingFileAppender, and from looking at the source, it catches
exceptions and just writes to console.  I'm writing transaction audit logs,
so if I can't write to the log (disk full, or whatever) I want to abort the
transaction.  Note that the log writing is done first; it doesn't need to
part of an atomic transaction.

First, is my reading of the code correct?  Will the code that calls log4j
not get an exception?

Second, any ideas on how to work around this?  Custom appender?  It seems
like a waste to re-implement RollingFileAppender.

Thanks for any help on this!

-----------------------------------------------------------------
Colin MacDonald  |  Software Developer  |  Templar Corporation  |
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.380 / Virus Database: 213 - Release Date: 7/24/2002


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: RollingFileAppender disk full handling

Posted by Kevin Steppe <ks...@pacbell.net>.
Colin,
    log4j does not throw exceptions.  However, the RollingFileAppender 
-should- make calls to the errorHandler.  Implement your own 
ErrorHandler and you should be able to get those notifications.

Kevin


Colin MacDonald wrote:

>Hi all!  In my application, I need to know if log4j failed to write a log
>message.
>
>I'm using RollingFileAppender, and from looking at the source, it catches
>exceptions and just writes to console.  I'm writing transaction audit logs,
>so if I can't write to the log (disk full, or whatever) I want to abort the
>transaction.  Note that the log writing is done first; it doesn't need to
>part of an atomic transaction.
>
>First, is my reading of the code correct?  Will the code that calls log4j
>not get an exception?
>
>Second, any ideas on how to work around this?  Custom appender?  It seems
>like a waste to re-implement RollingFileAppender.
>
>Thanks for any help on this!
>
>-----------------------------------------------------------------
>Colin MacDonald  |  Software Developer  |  Templar Corporation  |
>---
>Outgoing mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.380 / Virus Database: 213 - Release Date: 7/24/2002
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>