Hmmm, I'm getting confused. Assuming we are dealing with this snippet
of code:
using(ThreadContext.Stacks["NDC"].Push("Hello"))
{
log.Info("World");
}
and a layout pattern of "%message %ndc" you should see this output:
World Hello
--- Sean Carlin <[EMAIL PROTECTED]> wrote:
> I'm running .NET 2.0 and I don't have a value for it, either.
>
> Regards,
> Sean
>
> On 6/21/06, Ron Grabowski <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> 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
> >
>