Chat Support
Loupe - Log - Monitor - Resolve
Gibraltar.Agent Namespace / Log Class / EndSession Method / EndSession(SessionStatus,IMessageSourceProvider,String) Method
The explicit ending status to declare for this session, Normal or Crashed.
An IMessageSourceProvider object which supplies the source information about this log message.
A simple reason to declare why the application is ending as Normal or as Crashed, or may be null.

In This Topic
    EndSession(SessionStatus,IMessageSourceProvider,String) Method
    In This Topic
    Called at the end of the process execution cycle to indicate that the process shut down normally or explicitly crashed.
    Syntax
    'Declaration
     
    
    Public Overloads Shared Sub EndSession( _
       ByVal endingStatus As SessionStatus, _
       ByVal sourceProvider As IMessageSourceProvider, _
       ByVal reason As String _
    ) 

    Parameters

    endingStatus
    The explicit ending status to declare for this session, Normal or Crashed.
    sourceProvider
    An IMessageSourceProvider object which supplies the source information about this log message.
    reason
    A simple reason to declare why the application is ending as Normal or as Crashed, or may be null.
    Remarks

    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.

    Requirements

    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

    See Also