Add Loupe to Your Project

Start by adding the Gibraltar Loupe Agent NuGet package.

Enable Exception Logging

Add a couple lines to your App class and Loupe will log all unhandled exceptions.

using System.Windows;
using Gibraltar.Agent;

static class Program
    static void Main()
        Application.Run(new Form1());

Adjusting Error Reporting

By default, Loupe will automatically report unhandled exceptions to the user via the Loupe Error Manager dialog. If you prefer to silently log exceptions, set the reportErrorsToUser property to false.

Add Loupe Server for Exception Reporting

Add a couple more lines and Loupe Server will centralize log collection, analysis and error management.

<?xml version="1.0"?>
        <sectionGroup name="gibraltar">
            <section name="server"
                     type="Gibraltar.Agent.ServerElement, Gibraltar.Agent" />
        <server autoSendSessions="true"
                customerName="YOUR LOUPE SERVICE ACCOUNT" />
        <!-- If you have an on-premises Loupe Server, use this instead:
        <server autoSendSessions="true"
                server="YOUR LOUPE SERVER" /> -->

Ship our Packager Utility along with your application so sessions will be automatically transmitted in the background immediately after your application exits. 

That was easy! What's Next?

With just these few steps you're now collecting crucial details on every error, recording performance metrics and logging every trace message your program emits. 

Learn more about Loupe in our WinForms Developers Guide.