Logging
Introduction to Logging by Piers Lawson. Slightly dated, but still useful.
David Hayden has some good ideas on wrappers around logging to save some parameters/typing. Also decouples your app from the enterprise block - always a good idea.
Logging Quickstart
- Add the following references
Microsoft.Practices.EnterpriseLibrary.Logging.dll
Microsoft.Practices.EnterpriseLibrary.Common.dll
Microsoft.Practices.EnterpriseLibrary.ObjectBuilder.dll
- Add the following using statements (assumes C#)
using Microsoft.Practices.EnterpriseLibrary.Logging;
using Microsoft.Practices.EnterpriseLibrary.Logging.ExtraInformation;
using System.Diagnostics;
- Make the call to add a log entry (use intellisence to see all method overloads)
Logger.Write("Sample message", "UI Events", 5, 300, TraceEventType.Information);