Enterprise Library V6 Sample Projects

The following sample projects illustrate various Enterprise Library concepts and techniques.

Custom Database Trace Listener Sample

Description

This sample project shows a sample of a Custom Database Trace Listener that adds an additional column to the out of the boxFormattedDatabaseTraceListener.  The CustomDatabaseTraceListener will check the LogEntry to see if it is a CustomLogEntry and if it is then it will add the CustomData information into the CustomData column in the [Log] table.  

The Custom Database Trace Listener also support full design time integration with the Enterprise Library configuration tool as well as support for use with Enterprise Library's Fluent API.  

Requirements

  • Enterprise Library 6 (Assembly version 6.0.0.0).
  • Microsoft .NET Framework 4.5
  • Microsoft Visual Studio 2012
  • A database server running a database that is supported by a .NET Framework 4.5 data provider.  The provided script  does not work with SQL AZURE.  For SQL Azure support, modify the out of the box CreateLoggingDatabaseObjects.sql to include the CustomData column (as well as in stored procedures).

 

Rolling XML Trace Listener Sample & (Rolling) Flat File Trace Listeners

Description

This solution contains a sample of a rolling XML Trace Listener.
The functionality is based on (and leverages some of the functionality of) the Rolling Flat File Trace Listener so it should share the same behavior as that trace listener. The only difference is that the XML Trace Listener does not support a Header, Footer, or Formatter as the Rolling Flat File Trace Listener does.

The Rolling XML Trace Listener also support full design time integration with the Enterprise Library configuration tool. Simply copy the assembly into the config tool working folder of the configuration tool so it can load the trace listener type. If you are using EnterpriseLibrary.config as the configuration tool (Right click on app.config "Edit configuration file v6") then you will need to build the solution before opening with the configuration tool.

This solution also contains a Rolling Flat File Trace Listener as well as Flat File Trace Listener.
The functionality is based on the Rolling Flat File Trace Listener and Flat File Trace Listener
so it should share the same behavior as that trace listener. The only difference is that these new implementations
resolve an issue where an error occurs during initialization preventing any logging from working by throwing an
exception back to the caller when attempting to resolve a LogWriter from the container.

These Trace Listeners also support full design time integration with the Enterprise Library configuration tool. Simply copy the assembly into the config tool working folder of the configuration tool so it can load the trace listener type. If you are using EnterpriseLibrary.config as the configuration tool (Right click on app.config "Edit configuration file v6") then you will need to build the solution before opening with the configuration tool. They should appear as
"Custom Rolling Flat File Trace Listener" and "Custom Flat File Trace Listener" in the configuration tool.

Requirements

  • Enterprise Library 6 (Assembly version 6.0.0.0).
  • Microsoft .NET Framework 4.5
  • Microsoft Visual Studio 2012

 

Last edited Oct 25, 2013 at 4:55 PM by randylevy, version 5

Comments

No comments yet.