> -----Original Message-----
> From: Ron Grabowski [mailto:[EMAIL PROTECTED] 
> Sent: 23 March 2005 22:59
> To: Log4NET User
> Subject: Re: Release of log4net 1.2.9 beta
> 
> I found an answer to one of my questions:
> 
>  %property{UserIdentityName}

%property is used to access the combined properties map stored on the
event. The combined properties are made up of the event properties,
thread local properties and global properties. This replaces the MDC.
Programmatically the MDC is now just a wrapper around the
ThreadContext.Properties. The %X pattern is an alias for the %property
pattern and has exactly the same behaviour.

The NDC concept has also been combined with the properties model. The
NDC class is now a wrapper around TheadContext.Stacks["NDC"]. It is now
possible to have multiple stacks or NDCs going at the same time. The %x
pattern is equivalent to %property{NDC}.


 
> I saw that environment variables can be accessed using:
> 
>  %env{TMP}
> 
> Is the old syntax:
> 
>  %{TMP}
> 
> still valid/recommended?

The %env{NAME} pattern is supported by the PatternString class. This
class can be used to apply pattern syntax to any string property in the
XML config file. For example:

<file type="log4net.Util.PatternString" value="log-file-%processid.log"
/>

The type="log4net.Util.PatternString" specification on the element is
required to make this work.

The %{TMP} syntax is still supported. This behaviour is provided by the
config file parser itself and it is applied to all 'value' attributes in
the config file regardless of their property type. The %{TMP} syntax is
not extensible in any way, it is inelegant, however it will be
supported. The PatternString is much more powerful as custom patterns
can be specified in the config, however it is slightly more verbose.


> 
> There's a small typo on this page:
> 
> http://logging.apache.org/log4net/release/config-examples.html
> #HC-9936523
> 
> I think this line:
> 
>  log4net.Appender.FileAppender+MinimalLock

This is the correct syntax for accessing an inner/nested class in .NET.


Nicko



> 
> should read:
> 
>  log4net.Appender.FileAppender.MinimalLock
> 
> I think that's it for now. Good job on the new release!
> 
> - Ron
> 
> --- Ron Grabowski <[EMAIL PROTECTED]> wrote:
> > 
> > with the specific context that I placed the item into?
> > 
> >  %globalContext{UserIdentityName}
> > 
> 

Reply via email to