You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-user@logging.apache.org by Barak Simon <ba...@db.com> on 2004/09/15 05:07:21 UTC
Buffering Questions
Hi,
The following questions are about FileAppender and AsyncAppender buffering:
1. I found an example of how to configure the FileAppender to buffer the logging events:
<param name="ImmediateFlush" value="false"/>
<param name="BufferedIO" value="true"/>
(a) What's the difference between buffering and not-flushing (are there 4 distinct combinations I can configure?)
(b) Is there a way to configure the buffer size? (from script that is)
2. I could not find an example in the log4cxx side (there might be one on the java side) of how to configure the buffer size
for the async appender.
(And in general, is there a place where one can find the complete dtd in use?)
Many thanks,
Barak
________________________
Barak Simon
GED IT Core Platform
Deutsche Bank
190 George St. Sydney, 2000
Phone +61 2 925 85070
Fax +61 2 925 95050
--
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
Re: Buffering Questions
Posted by Michaël CATANZARITI <mc...@free.fr>.
Hello the option ImmediateFlush force each new log event to be written immediately to the file. It can degrade performances, but if your application crashes, the log file is up to date.
The bufferSize option is not implemented still the stl ofstream does not implement it.
Regards,
Michaël
Christophe de VIENNE wrote:
> Hi,
>
> Barak Simon wrote:
>
>> Hi,
>> The following questions are about FileAppender and AsyncAppender
>> buffering:
>>
>> 1. I found an example of how to configure the FileAppender to buffer
>> the logging events:
>>
>> <param name="ImmediateFlush" value="false"/>
>> <param name="BufferedIO" value="true"/>
>>
>> (a) What's the difference between buffering and not-flushing (are
>> there 4 distinct combinations I can configure?)
>> (b) Is there a way to configure the buffer size? (from script that is)
>>
>>
>
> From what I see in the source :
>
> BufferedIO = true implies ImmediateFlush = false
>
> ImmediateFlush is handled by WriterAppender, which will do a
> ostream::flush after each output.
>
> BufferedIO is specific to FileAppender. The buffer size can be set via
> the "buffersize" property. However is seems that those properties
> (bufferedIO and buffersize) will be silently ignored, since the relevant
> code is commented.
>
>
>> 2. I could not find an example in the log4cxx side (there might be one
>> on the java side) of how to configure the buffer size
>> for the async appender.
>>
>>
> Do you mean by configuration script ?
> In the source the function is setBufferSize. I guess a buffersize
> property is usable in the script. Note that ASyncAppender can only be
> script configured using an xml file.
>
>> (And in general, is there a place where one can find the complete
>> dtd in use?)
>>
>>
> I don't know.
>
>
>
> Regards
>
> Christophe
>
Re: Buffering Questions
Posted by Christophe de VIENNE <cd...@alphacent.com>.
Hi,
Barak Simon wrote:
>Hi,
>The following questions are about FileAppender and AsyncAppender buffering:
>
>1. I found an example of how to configure the FileAppender to buffer the logging events:
>
> <param name="ImmediateFlush" value="false"/>
> <param name="BufferedIO" value="true"/>
>
> (a) What's the difference between buffering and not-flushing (are there 4 distinct combinations I can configure?)
> (b) Is there a way to configure the buffer size? (from script that is)
>
>
From what I see in the source :
BufferedIO = true implies ImmediateFlush = false
ImmediateFlush is handled by WriterAppender, which will do a ostream::flush after each output.
BufferedIO is specific to FileAppender. The buffer size can be set via the "buffersize" property. However is seems that those properties (bufferedIO and buffersize) will be silently ignored, since the relevant code is commented.
>2. I could not find an example in the log4cxx side (there might be one on the java side) of how to configure the buffer size
> for the async appender.
>
>
Do you mean by configuration script ?
In the source the function is setBufferSize. I guess a buffersize
property is usable in the script. Note that ASyncAppender can only be
script configured using an xml file.
> (And in general, is there a place where one can find the complete dtd in use?)
>
>
I don't know.
Regards
Christophe
--
Christophe de Vienne
Alpha Centauri
tel: 01 47 82 93 78