You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by Zia Haider <zi...@omexsystems.com> on 2015/11/17 17:11:51 UTC

Asynchronous mode for AdoNetAppender.

 

Hi there,

 

I have been using log4net FileAppender for some time, but now I need to log
all my data in to database.

I am trying to use AdoNetAppender for that, but I it is working in
synchronous mode.

 

I noticed that FileAppender works in asynchronous mode where AdoNetAppender
works in synchronous mode.

 

Is there any property/method to run AdoNetAppender in asynchrousnous mode? 

Please let me know the correct usage for AdoNetAppender.

 

 

Zia Haider

OMEX Systems Inc.

 


Re: Asynchronous mode for AdoNetAppender.

Posted by Dominik Psenner <dp...@apache.org>.
Hi,

AdoNetAppender actually derives from BufferingAppenderSkeleton which 
buffers events before flushing a bunch of events to the database in one 
go. The typical configurations for a buffering appender are therefore 
available:

* Lossy 
(https://logging.apache.org/log4net/release/sdk/html/P_log4net_Appender_BufferingAppenderSkeleton_Lossy.htm)
* BufferSize 
(https://logging.apache.org/log4net/release/sdk/html/P_log4net_Appender_BufferingAppenderSkeleton_BufferSize.htm)
* Evaluator 
(https://logging.apache.org/log4net/release/sdk/html/P_log4net_Appender_BufferingAppenderSkeleton_Evaluator.htm)
* LossyEvaluator 
(https://logging.apache.org/log4net/release/sdk/html/P_log4net_Appender_BufferingAppenderSkeleton_LossyEvaluator.htm)

These properties give you full control over the buffering behavior of 
the AdoNetAppender.

Cheers

On 2015-11-17 17:11, Zia Haider wrote:
>
> Hi there,
>
> I have been using log4net FileAppender for some time, but now I need 
> to log all my data in to database.
>
> I am trying to use AdoNetAppender for that, but I it is working in 
> synchronous mode.
>
> I noticed that FileAppender works in asynchronous mode where 
> AdoNetAppender works in synchronous mode.
>
> Is there any property/method to run AdoNetAppender in asynchrousnous 
> mode?
>
> Please let me know the correct usage for AdoNetAppender.
>
> *Zia Haider*
>
> OMEX Systems Inc.
>