LogicalThreadContextStack Clear Method | Apache log4net™ SDK Documentation

Clears all the contextual information held in this stack.

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

C#
VB
C++
F#
Copy

    public void Clear()

    Public Sub Clear

    public:
    void Clear()

    member Clear : unit -> unit

Remarks

Clears all the contextual information held in this stack. Only call this if you think that this thread is being reused after a previous call execution which may not have completed correctly. You do not need to use this method if you always guarantee to call the Dispose
method of the IDisposable returned from Push(String) even in exceptional circumstances, for example by using the using(log4net.LogicalThreadContext.Stacks["NDC"].Push("Stack_Message")) syntax.

See Also

#### Reference

LogicalThreadContextStack Class
log4net.Util Namespace