Did you consider subclassing the FileAppender?


-----Original Message-----
From: T Master [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 17, 2002 5:33 PM
To: [EMAIL PROTECTED]
Subject: How may I catch an IOException when there disk space has run
out for a FileAppender?


1. How may I catch an exception thrown when there disk space has run out for
a FileAppender?

2.  It would be nice to register a listener (imho) for when diskspace runs
out.



Console Output  from such a scenario:

log4j:ERROR Failed to flush writer,
java.io.IOException: There is not enough space on the disk
        at java.io.FileOutputStream.writeBytes(Native Method)
        at java.io.FileOutputStream.write(FileOutputStream.java:212)
        at
java.io.OutputStreamWriter.flushBuffer(OutputStreamWriter.java:230)
        at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:244)
        at org.apache.log4j.helpers.QuietWriter.flush(QuietWriter.java:49)
        at
org.apache.log4j.WriterAppender.subAppend(WriterAppender.java:309)
        at
org.apache.log4j.RollingFileAppender.subAppend(RollingFileAppender.ja
va:294)
        at org.apache.log4j.WriterAppender.append(WriterAppender.java:157)
        at
org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:251)

        at
org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders
(AppenderAttachableImpl.java:57)
        at org.apache.log4j.Category.callAppenders(Category.java:255)
        at org.apache.log4j.Category.forcedLog(Category.java:445)
        at org.apache.log4j.Category.info(Category.java:704)


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

Reply via email to