Hi. I've not encountered the buffering. When a log message cannot be written ( insufficient diskspace) then the appenders errorHandler is invoked.
I wrote my own to display the error msg to another specified Appender only. Trivial process. It all depends on your logging policy. Do you want to auto-delete old log files to make space available? In my case, all log files are important and must never be auto-deleted by my application. Perhaps a backup volume could be specified. Or auto-zipping of log files to make more space (though in the end, all spcae will still be used, and the memory requirements of zipping are a lot imho); T Master ----- Original Message ----- From: "Keith Schomburg" <[EMAIL PROTECTED]> To: "Log4j" <[EMAIL PROTECTED]> Sent: Wednesday, February 27, 2002 11:14 AM Subject: RE: How may I catch an IOException when there disk space has run out for a FileAppender? > > What is the behavior of log4j when there is not more available disk > space? Will log4j buffer up messages until sufficient disk space > is freed up or will it silently drop messages? > > We have recently run into this problem as well. The behavior that > appeared to be occurring was that messages that were unable to > be logged due to insufficient disk space were buffered up and later > written out when disk space was freed up. If this is the actual > behavior of log4j this seems a little dangerous in that it could then > not only exhaust disk space but heap space as well due to buffered > log messages. > > Keith > > > -----Original Message----- > > From: Ceki Gülcü > > Subject: Re: How may I catch an IOException when there disk space has run > > out for a FileAppender? > > Date: Fri, 18 Jan 2002 15:39:52 -0800 > > > > T Master, > > > > Have you considered ErrorHandlers? You can atttach an ErrorHandler > > to any appender. See for example FallbackErrorHandler. > > > > http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/varia/Fa > > llbackErro > > rHandler.html > > > > Regards, Ceki > > > > ps: My name is Ceki not Ceiki. Thank you. > > > > At 14:18 18.01.2002 -0700, you wrote: > > >Ceiki, > > > > > >Do you have an answer for the problem below? > > > > > >If there was a listener allowed, then I could change the file paths > > >(assuming i had a spare disk to use). > > > > > >T Master. > > > > > > > > >----- Original Message ----- > > >From: "T Master" <[EMAIL PROTECTED]> > > >To: <[EMAIL PROTECTED]> > > >Sent: Thursday, January 17, 2002 6:32 PM > > >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]> > > >> > > > > > > > > >-- > > >To unsubscribe, e-mail: > > <mailto:[EMAIL PROTECTED]> > > >For additional commands, e-mail: > > <mailto:[EMAIL PROTECTED]> > > > > -- > > Ceki Gülcü - http://qos.ch > > > > > > > > -- > > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>