'Declaration
Public Overloads Shared Sub EndSession( _ ByVal endingStatus As SessionStatus, _ ByVal reason As String _ )
public static void EndSession( SessionStatus endingStatus, string reason )
'Declaration
Public Overloads Shared Sub EndSession( _ ByVal endingStatus As SessionStatus, _ ByVal reason As String _ )
public static void EndSession( SessionStatus endingStatus, string reason )
This will put the Loupe Agent into an ending state in which it will flush everything still in its queue and then switch to a background thread to process any further messages. All messages submitted after this call will block the submitting thread until they are committed to disk, so that any foreground thread still recording final items will be sure to get them through before they exit.
In WinForms applications this method is called automatically when an ApplicationExit event is received. It is also called automatically when the Agent is registered as a Trace Listener and Trace.Close is called.
If EndSession is never called, the log will reflect that the session must have crashed.
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2