logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Carlin" <seancar...@gmail.com>
Subject Re: NDC and MDC fields logged as (null)
Date Fri, 23 Jun 2006 13:09:40 GMT
I'm running .NET 2.0 and I don't have a value for it, either.

Regards,
Sean

On 6/21/06, Ron Grabowski <rongrabowski@yahoo.com> wrote:
>
> The NDC is implemented with a ThreadContextStack which internally uses
> a Stack to store values. If you don't push anything onto the NDC, the
> Stack remains empty with a Count of zero.
>
> The NDC has a value when log messages are written inside of its scope:
>
> using(ThreadContext.Stacks["NDC"].Push("Hello"))
> {
>   log.Info("World");
> }
>
> --- Ken Chu <ken_c_chu@yahoo.com> wrote:
>
> > Hmm, you mean the NDC doesn't always have a value?  Then when is the
> > NDC not
> > empty?  I had assumed it always had a value of some sort, like a
> > thread id.
> >
> > -Ken
>

Mime
View raw message