This project has moved. For the latest updates, please go here.

LogViewer.Demo

1. Overview

The LogViewer demonstration consists of two projects:
  1. LogViewer: Allows the user to see the log entries in an application window (Bottom window in Figure 1). It provides a CustomTraceListener for the Logging Application Block which can be configured in the application configuration file.
  2. LogViewer.Demo: Is a sample module for showing how to use the logging mechanism of the Logging Application Block. It contains a view to define the various log entry properties and a button to log the data (Figure 1).

log-viewer.png
Figure 1

2. Configuration

The Logging Application Block of the Enterprise Library needs to be configured through the application configuration file. The LogViewerTraceListener has to be configured to activate the LogViewer module. In Listing 1 the LogViewerTraceListener is configured to show all logs.

<listeners>
  <add listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.CustomTraceListenerData, 
    Microsoft.Practices.EnterpriseLibrary.Logging" traceOutputOptions="None"
    type="Jbe.TestSuite.LogViewer.LogViewerTraceListener, Jbe.TestSuite.LogViewer"
    name="LogViewer TraceListener"
    initializeData=""
  />
</listeners>

<specialSources>
  <allEvents switchValue="All" name="All Events">
    <listeners>
      <add name="LogViewer TraceListener" />
    </listeners>
  </allEvents>
  ...

Listing 1

Last edited Oct 8, 2007 at 2:50 PM by jbe2277, version 4

Comments

No comments yet.