Welcome to the Glimpse Documentation! Here we hope to introduce you to the various tutorials, concepts and APIs you might need when discovering and using Glimpse.

NOTE: Glimpse docs are currently being improved. If you'd like to help out, just edit this page or contribute to our GitHub Wiki


When installing Glimpse via Nuget, all of this configuration is taken care of for you. So you only need to worry about the details, when you want to change something or take manual control.

At it's core, Glimpse is configured with a custom section called <glimpse> in your web application's web.config file. Installing using NuGet will automatically update web.config to the minimal configuration.

Configuration options:

Minimal configuration

Glimpse's minimal configuration adds a custom configuration section, and registers a HTTP module and HTTP handler.

Custom section

Glimpse needs a custom <section> in the <configSections>, named glimpse, in web.config.

        <section name="glimpse" type="Glimpse.Core.Configuration.Section, Glimpse.Core" />

HTTP module and HTTP handler

Glimpse needs a custom HTTP module and HTTP handler with ASP.NET, in the <system.web> section if you have IIS 6 or earlier, or in the <system.webServer> section for later versions of IIS.

For <system.web>:

        <add name="Glimpse" type="Glimpse.AspNet.HttpModule, Glimpse.AspNet"/>
        <add path="glimpse.axd" verb="GET" type="Glimpse.AspNet.HttpHandler, Glimpse.AspNet"/>

For <system.webServer>:

        <add name="Glimpse" type="Glimpse.AspNet.HttpModule, Glimpse.AspNet" preCondition="integratedMode"/>
        <add name="Glimpse" path="glimpse.axd" verb="GET" type="Glimpse.AspNet.HttpHandler, Glimpse.AspNet"  preCondition="integratedMode" />

Changing the configuration

You can change Glimpse's behavior by:

  • changing which tabs are displayed
  • enabling, disabling and customizing security policies
  • changing the logging level

Configuring tabs

You can disable Glimpse tabs by instructing Glimpse to ignore their types:

<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
            <add type="{Namespace.Type, AssemblyName}"/>

The default Glimpse tabs are:

  • Diagnostics:
    • Timeline - Glimpse.Core.Tab.Timeline
    • Trace - Glimpse.Core.Tab.Trace
  • ASP.NET:
  • ADO.NET:
    • SQL - Glimpse.ADO.Tab.SQL

You can't disable the Ajax or History tabs, because they're integral to Glimpse.

Configuring runtime policy

Policies control what Glimpse is allowed to do to any given request. Policies can be disabled and customized to simplify some scenarios.

For example, to run Glimpse on a remote server (like a server in Windows Azure), disable the LocalPolicy:

<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd" >
            <add type="Glimpse.AspNet.Policy.LocalPolicy, Glimpse.AspNet"/>

Similarly, the ControlCookiePolicy can be disabled to remove the need to turn Glimpse on and off in the browser:

<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
            <add type="Glimpse.Core.Policy.ControlCookiePolicy, Glimpse.Core"/>

Glimpse will never be allowed more permissions than the defaultRuntimePolicy allows. On and Off are the simplest configuration values, but there are many more options:

  • Off: Does not allow Glimpse to perform any operations or capture any data.
  • PersistResults: Allows Glimpse to only capture request metadata.
  • ModifyResponseHeaders: Allows Glimpse to write custom headers and set cookies on HTTP responses in addition to capturing and persisting results.
  • ModifyResponseBody: Allows Glimpse to write to a HTTP response body, in addition to modifying headers and to capture and persist results.
  • DisplayGlimpseClient: Allows Glimpse to write the Glimpse JavaScript client <script> tag to the HTTP response body, in addition to writting headers and to capture and persist results.
  • On: Allows Glimpse to run all above mentioned operations against an HTTP request/response.

In addition to the above policy configuration options, some policies allow for additional configuration:

Content Types that Glimpse will respond to can be added and removed with the <contentTypes> whitelist element.

<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
        <add contentType="application/xml"/>
        <!-- <clear/> -->

Status Codes are similar to content types in that the status codes that Glimpse will respond to can be added and removed with the <statusCodes> whitelist element.

<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
        <add statusCode="404"/>

URIs that Glimpse will respond to can be filtered with the <uris> blacklist element of regular expressions. This example disables Glimpse for all requests to /admin for the configured web application.

<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
        <add regex=".*/admin.*"/>

Configuring logging

If you're having problems with Glimpse, you can enable the internal Glimpse diagnostics log:

<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
    <logging level="Trace" />

The level attribute can be set to Trace, Debug, Info, Warn, Error or Fatal. The default value is Off.

The <logging> element has an additional attribute called logLocation which sets the location of the log file. By default, logLocation is Glimpse.log in your web application's root directory.