NDC Inherit Method | Apache log4net™ SDK Documentation

Inherits the contextual information from another thread.

Namespace: log4net
Assembly: log4net (in log4net.dll) Version: 2.0.8.0-.NET 4.0
Syntax

C#
VB
C++
F#
Copy

    public static void Inherit(
    	Stack stack
    )

    Public Shared Sub Inherit (
    	stack As Stack
    )

    public:
    static void Inherit(
    	Stack^ stack
    )

    static member Inherit :
            stack : Stack -> unit

#### Parameters

stack
  Type: System.Collections
  Stack
  The context stack to inherit.

Remarks

Note
The NDC is deprecated and has been replaced by the Stacks. The current NDC implementation forwards to the ThreadContext.Stacks["NDC"].

This thread will use the context information from the stack supplied. This can be used to initialize child threads with the same contextual information as their parent threads. These contexts will NOT be shared. Any further contexts that are pushed onto the stack will not be visible to the other. Call CloneStack
to obtain a stack to pass to this method.

See Also

#### Reference

NDC Class
log4net Namespace