This project is read-only.


The recommended method to install the adapter is through NuGet:

The package is called Common.Logging.Loupe

If you would like to use the binary directly you will need to obtain the following dependencies:

  1. Common.Logging (v ≥ 2.1.2)
  2. Gibraltar Agent (v ≥


We have issued several new versions of this package to maintain compatibility with different versions of Common.Logging.

1.3.1.x | Common.Logging 3.1+
1.3.0.x | Common.Logging 3.0
1.2.2.x | Common.Logging 2.2
1.2.1.x | Common.Logging 2.1


A detailed usage example is included in the Common.Logging.Loupe.Example project. The following is a simplified version:


Configure the Gibraltar element in App.config using the following instructions/documentation:



<?xml version="1.0" encoding="UTF-8"?>
<sectionGroup name="gibraltar">
<section name="listener" type="Gibraltar.Agent.ListenerElement, Gibraltar.Agent" />
<section name="packager" type="Gibraltar.Agent.PackagerElement, Gibraltar.Agent" />
<section name="publisher" type="Gibraltar.Agent.PublisherElement, Gibraltar.Agent" />
<section name="sessionFile" type="Gibraltar.Agent.SessionFileElement, Gibraltar.Agent" />
<section name="viewer" type="Gibraltar.Agent.ViewerElement, Gibraltar.Agent" />
<section name="email" type="Gibraltar.Agent.EmailElement, Gibraltar.Agent" />
<section name="server" type="Gibraltar.Agent.ServerElement, Gibraltar.Agent" />
<section name="autoSendConsent" type="Gibraltar.Agent.AutoSendConsentElement, Gibraltar.Agent" />
<section name="networkViewer" type="Gibraltar.Agent.NetworkViewerElement, Gibraltar.Agent" />
<section name="properties" type="System.Configuration.NameValueSectionHandler" />
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
<!-- Here is where all of the Gibraltar configuration sections can be added. -->
<add name="gibraltar" type="Gibraltar.Agent.LogListener, Gibraltar.Agent" />
<factoryAdapter type="Common.Logging.Loupe.LoupeFactoryAdapter, Common.Logging.Loupe">
<arg key="level" value="Trace" />
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity name="Common.Logging" publicKeyToken="af08829b84f0328e" culture="neutral" />
<bindingRedirect oldVersion="" newVersion="" />

Getting a Class Logger

The first step in writing to the log file is to obtain a logger for the current class.  This can be done through the static LogManager.GetCurrentClassLogger() method call:

var logger = LogManager.GetCurrentClassLogger();

This will obtain an implementation of ILog which exposes logging methods should as Error, Warning, and Info.  The full documentation for ILog can be found here:  Common Logging Usage


Ending a Session

Gibraltar logging relies on the concept of a log session.  When your application is exiting the session should end.  If you do not explicitly close the session Gibraltar will assume that the session has terminated unexpectedly.  

A session can be ended in the following ways:

  1. Directly through the Gibraltar.Log static class methods.
    Gibraltar.Agent.Log.EndSession("Session Finished");
  2. Through the Common.Logging.Loupe.LoupeLogUtility static class methods
    Common.Logging.Loupe.LoupeLogUtility.EndSessionNormally("Session Finished.");

For more information about session please see the integration section of the Loupe documentation:

Last edited Aug 2, 2015 at 7:09 PM by ams3cf, version 6