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 James Stauffer <st...@gmail.com> on 2007/04/10 21:35:51 UTC

Re: AsyncAppender Issue

How are you configuring AsyncAppender.  I think it has an option that
throws away logs when the buffer is full.

On 4/10/07, Luedecke, Michael J <mi...@eds.com> wrote:
> I'm losing logs when I use the AsyncAppender for some reason.  This loss
> of logs occurs whether I'm using a custom appender or out-of-the-box
> appender (i.e. FileAppender).
>
> I have not noticed this problem when I send a string in the log method
> call.  It only seems to happen when I pass an object in the log method
> call.  The object I'm sending in the log is not large or complex.  It is
> a HashMap collection containing only 5 or 6 entries.
>
> The logs that get created successfully varies.  Sometimes I get all of
> the logs I'm expecting, but, most of the time I don't.  If I use the
> appenders without the AsyncAppender I'm consistently getting all of the
> expected logs.
>
> I'm not creating a large number of logs (my test case only creates 3
> logs).  Nevertheless, I have tried to change all of the options used by
> the AsyncAppender just in case, but it has not resolved anything.
>
> Other characteristics of my environment:
> * Using log4j 1.2.14
> * Using JDK 1.4.2_14
> * OS is Windows XP
>
> Has anyone else experienced this type of behavior with the
> AsyncAppender?
>
> Thanks.
>
>
>


-- 
James Stauffer        http://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


RE: AsyncAppender Issue

Posted by "Luedecke, Michael J" <mi...@eds.com>.
Here is the AsyncAppender configuration in my log4j.xml file:

<appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
	<param name="BufferSize" value="128" />
      <param name="LocationInfo" value="true" />
      <param name="Blocking" value="true" />
	<appender-ref ref="Local" />
</appender> 

I've tried setting buffer to "false" and "true".  I'm only creating
three logs in my test case, so I was thinking this may not be a full
buffer problem.

Thanks.

-----Original Message-----
From: James Stauffer [mailto:stauffer.james@gmail.com] 
Sent: Tuesday, April 10, 2007 2:36 PM
To: Log4J Users List
Subject: Re: AsyncAppender Issue

How are you configuring AsyncAppender.  I think it has an option that
throws away logs when the buffer is full.

On 4/10/07, Luedecke, Michael J <mi...@eds.com> wrote:
> I'm losing logs when I use the AsyncAppender for some reason.  This 
> loss of logs occurs whether I'm using a custom appender or 
> out-of-the-box appender (i.e. FileAppender).
>
> I have not noticed this problem when I send a string in the log method

> call.  It only seems to happen when I pass an object in the log method

> call.  The object I'm sending in the log is not large or complex.  It 
> is a HashMap collection containing only 5 or 6 entries.
>
> The logs that get created successfully varies.  Sometimes I get all of

> the logs I'm expecting, but, most of the time I don't.  If I use the 
> appenders without the AsyncAppender I'm consistently getting all of 
> the expected logs.
>
> I'm not creating a large number of logs (my test case only creates 3 
> logs).  Nevertheless, I have tried to change all of the options used 
> by the AsyncAppender just in case, but it has not resolved anything.
>
> Other characteristics of my environment:
> * Using log4j 1.2.14
> * Using JDK 1.4.2_14
> * OS is Windows XP
>
> Has anyone else experienced this type of behavior with the 
> AsyncAppender?
>
> Thanks.
>
>
>


-- 
James Stauffer        http://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org