Loupe - Log - Monitor - Resolve
Gibraltar.Agent Namespace / LogListener Class
Members Example

In This Topic
    LogListener Class
    In This Topic
    Implements a TraceListener to forward Trace and Debug messages from System.Diagnostics.Trace to the Loupe Agent.
    Syntax
    'Declaration
     
    
    Public NotInheritable Class LogListener 
       Inherits System.Diagnostics.TraceListener
    public sealed class LogListener : System.Diagnostics.TraceListener 
    Remarks

    This class is not normally used directly but instead is registered in the App.Config file according to the example above.

    For more information on how to record log messages with the Loupe Agent, see the Log Class.

    For more information on logging using Trace, see Developer's Reference - Logging - Using with Trace.

    Example
    The easiest way to add Loupe to an application is to register it in the App.Config XML file. Each application has an XML configuration file that is used to hold options that can be changed without recompiling the application. These options apply to all users of the application.
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
    <!-- You may already have a <system.diagnostics> section in your configuration file,
       possibly also including the <trace> and <listeners> tags.  If this is the case,
       you only need to add the line that starts <add name="gibraltar" ... /> to the file -->
     <system.diagnostics>
       <trace>
         <listeners>
           <add name="gibraltar" type="Gibraltar.Agent.LogListener, Gibraltar.Agent"/>
         </listeners>
       </trace>
     </system.diagnostics>
    </configuration>
    Inheritance Hierarchy

    System.Object
       System.MarshalByRefObject
          System.Diagnostics.TraceListener
             Gibraltar.Agent.LogListener

    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

    Reference

    LogListener Members
    Gibraltar.Agent Namespace

    Developer's Reference

    Logging - Using with Trace