Hi, If I were to set log4j.appender.MyAppender.immediateFlush = FALSE, whats the size of the log messages buffered before it is outputted to the file ?? Can I set it ?
I understand that few messages may get lost, but I feel this would prevent heavy disk activity as David pointed out. Any suggestions ?? Thnx, -----Original Message----- From: David Tonhofer, m-plify S.A. [mailto:[EMAIL PROTECTED] Sent: domingo, 15 de Agosto de 2004 19:14 To: Log4J Users List Subject: Re: Flushing the log to file? Hi, The 'flushing' behaviour depends on the Appender. Some Appenders flush after each line (this takes a heavy toll on disk activity though). Check for a property called 'immediateFlush' which is exported by org.apache.log4j.WriterAppender and any classes derived from it. It is 'true' by default though, so if you are using ConsoleAppender there should be not 'lost line' phenomenon. You can set the property through a property file, like this: log4j.appender.MyAppender.immediateFlush = true Best, -- David --On Saturday, August 14, 2004 9:21 AM -0700 "Schuhmacher, Bret" <[EMAIL PROTECTED]> wrote: > Is Log4J buffered? I have the following statements: > myLog.fatal("a fatal log message here"); > System.Exit(-2); > > The fatal message never gets written. Do I need to flush the buffer to > disk somehow? I couldn't find a method to do so (at least nothing like > "flush()"). > > Thanks, > > Bret > -- > Bret A. Schuhmacher voice: 423.837.7563 > Sr. Architect, Aspect Professional Services eMail: > [EMAIL PROTECTED] > Aspect Communications > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- David Tonhofer M-PLIFY S.A. Resp. Informatique 47, av. de la Libert� L-1931 Luxembourg Tel: +352 261846-52 Fax: +352 261846-46 Mob: +352 021-139031 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.735 / Virus Database: 489 - Release Date: 06-08-2004 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.735 / Virus Database: 489 - Release Date: 06-08-2004 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
