You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by "tirath.g" <ti...@hotmail.com> on 2014/06/12 05:59:07 UTC

set buffersize conditionally?

hi,

is it possible to set buffersize conditionally. i am trying to use log4net
for entire orgnaziation solution and writing info to a database table. can i
set different values of buffer size programically depending on some
condition( like request coming from application 1 to use buffer size = 100
others to use 1). thankyou.



--
View this message in context: http://apache-logging.6191.n7.nabble.com/set-buffersize-conditionally-tp48117.html
Sent from the Log4net - Users mailing list archive at Nabble.com.

AW: set buffersize conditionally?

Posted by Dominik Psenner <dp...@gmail.com>.
Good morning

 

You can tell log4net to flush the buffer on specific events (see Evaluator property in the class log4net.Appender.BufferingAppenderSkeleton). However, you can have exactly one buffer size for each buffering appender because every appender has exactly one buffer. You could configure multiple appenders for every domain you have and thus every domain can have its own buffer size.

 

Changing the buffer size at runtime sounds dangerous to me and therefore I discourage you to try that, but if you know what you are doing take a look at http://stackoverflow.com/questions/2458227/why-isnt-my-log4net-appender-buffering and remember to call ActivateOptions() after changing the BufferSize.

 

Cheers

 

Von: d_k [mailto:mail4dk@gmail.com] 
Gesendet: Donnerstag, 12. Juni 2014 06:25
An: Log4NET User
Betreff: Re: set buffersize conditionally?

 

Well, you can have a different configuration file for each application and set their values accordingly.

 

On Thu, Jun 12, 2014 at 6:59 AM, tirath.g <tirath.g@hotmail.com <ma...@hotmail.com> > wrote:

hi,

is it possible to set buffersize conditionally. i am trying to use log4net
for entire orgnaziation solution and writing info to a database table. can i
set different values of buffer size programically depending on some
condition( like request coming from application 1 to use buffer size = 100
others to use 1). thankyou.



--
View this message in context: http://apache-logging.6191.n7.nabble.com/set-buffersize-conditionally-tp48117.html
Sent from the Log4net - Users mailing list archive at Nabble.com.

 


Re: set buffersize conditionally?

Posted by d_k <ma...@gmail.com>.
Well, you can have a different configuration file for each application and
set their values accordingly.


On Thu, Jun 12, 2014 at 6:59 AM, tirath.g <ti...@hotmail.com> wrote:

> hi,
>
> is it possible to set buffersize conditionally. i am trying to use log4net
> for entire orgnaziation solution and writing info to a database table. can
> i
> set different values of buffer size programically depending on some
> condition( like request coming from application 1 to use buffer size = 100
> others to use 1). thankyou.
>
>
>
> --
> View this message in context:
> http://apache-logging.6191.n7.nabble.com/set-buffersize-conditionally-tp48117.html
> Sent from the Log4net - Users mailing list archive at Nabble.com.
>