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

In This Topic
    ServerConfiguration Class
    In This Topic
    The application configuration information for sending session data to a Loupe Server
    Public Class ServerConfiguration 
    public class ServerConfiguration 

    To configure integration with the Loupe Server you need to either:

    Using the Gibraltar Loupe Service

    Just set the UseGibraltarService option to True and specify your Account name which you can find at www.GibraltarSoftware.com.

    Using a Private Loupe Server

    You will need to know the connection information from when the server was installed to correctly configure some or all of the following values:

    • Server (required): The full DNS name of the computer hosting the Loupe Server.
    • ApplicationBaseDirectory (optional): The virtual directory on the server where the Loupe Server is installed. It may be empty, indicating the server is installed in the root of its web site.
    • UseSsl (optional): Defaults to false; indicates if the connection with the server should be encrypted using Secure Sockets Layer (SSL). If no port is specified then port 443 (the standard for SSL) will be used.
    • Port (optional): Used to specify a nonstandard port to communicate with the server.

    Automatically Sending Sessions

    The server configuration is used both to establish the connection information for the Loupe Server for on-demand transfer (such as with the Packager Dialog or Packager class) and also for automatic background session transfer. To enable automatic background transfer of all sessions:

    • Set the AutoSendSessions option to True
    • Optionally set the SendAllApplications option to send session data for any application that shares the same Product name as the current application.
    • Optionally set the PurgeSentSessions option to True to remove sessions from the local computer once they have been successfully sent to the Loupe Server.

    Testing your Configuration

    You can validate the current configuration at runtime by calling the Validate method. If there are any problems with the configuration data an exception will be thrown describing the issue. Some problems (like an invalid customer name or server name) may not be fully detectable in this routine.

    If the configuration is not valid the Enabled property is automatically set to False at the end of the Log.Initializing event. This isn't checked until the end of the initialization cycle so properties can be set in any order.

    You can configure the entire Loupe Server connection in the Log Initializing event of your application (not recommended for ASP.NET)
    /// <summary>
    /// The primary program entry point.
    /// </summary>
    static class Program
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        public static void Main()
            Log.Initializing += Log_Initializing;
            Thread.CurrentThread.Name = "User Interface Main";  //set the thread name before our first call that logs on this thread.
            Log.StartSession("Starting Loupe Desktop");
            //here you actually start up your application
            //and if we got to this point, we done good and can mark the session as being not crashed :)
            Log.EndSession("Exiting Loupe Desktop");
        static void Log_Initializing(object sender, LogInitializingEventArgs e)
            //and configure Loupe Server Connection
            ServerConfiguration server = e.Configuration.Server;
            server.UseGibraltarService = true;
            server.CustomerName = "Gibraltar Software";
            server.AutoSendSessions = true;
            server.SendAllApplications = true;
            server.PurgeSentSessions = true;
    Inheritance Hierarchy



    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