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 "Vanderkolk, John" <Jo...@compuware.com> on 2007/07/02 14:23:06 UTC

Changing LockingModel at runtime

Hello all,

If in my config file I set all of my appenders as MinimalLock appenders,
is it possible to later set a specific appender (which I already have
code to grab) over to an ExclusiveLock? Also, if I set my config file as
a read and watch, when/if it reloads the config file, will the appender
be moved back to a MinimalLock, and if it will, is there any way of
preventing this?

What would the code look like (in C#) to change the locking model at
runtime assuming I've already extracted the appender from the
repository.

John VanderKolk
john.vanderkolk@compuware.com


The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it. 

Re: Changing LockingModel at runtime

Posted by vikas <vi...@hotmail.com>.
Vanderkolk, John <John.Vanderkolk <at> compuware.com> writes:

> 
> 
> 
> 
> Hello all,
> 
> 
> If in my config file I set all of my appenders as MinimalLock appenders, is 
it possible to later set a specific appender (which I already have code to 
grab) over to an ExclusiveLock? Also, if I set my config file as a read and 
watch, when/if it reloads the config file, will the appender be moved back to a 
MinimalLock, and if it will, is there any way of preventing this?
> 
> What would the code look like (in C#) to change the locking model at runtime 
assuming I've already extracted the appender from the repository.
> 
> John VanderKolk
> 
> john.vanderkolk <at> compuware.com
> 
> 
> The contents of this e-mail are intended for the named addressee only. It 
contains information that may be confidential. Unless you are the named 
addressee or an authorized designee, you may not copy or use it, or disclose it 
to anyone else. If you received it in error please notify us immediately and 
then destroy it.

Use 

.LockingModel = new FileAppender.MinimalLock();