public class UltimateTextWriterTraceListener : UltimateTraceListener
Add log capability to your application.
// Set the log level. ComponentPro.Diagnostics.XTrace.Default.Level = ComponentPro.Diagnostics.TraceEventType.Verbose; // By default the AutoFlush property is true. // If you wish to turn it off, just set it to false as follows: // ComponentPro.Diagnostics.XTrace.AutoFlush = false; // Add the UltimateTextWriterTraceListener listener to write to a file. ComponentPro.Diagnostics.XTrace.Default.Listeners.Add( new ComponentPro.Diagnostics.UltimateTextWriterTraceListener("c:\\temp\\log.log")); // You can also write log to a Console window with the following code: ComponentPro.Diagnostics.XTrace.Default.Listeners.Add(new ComponentPro.Diagnostics.UltimateConsoleTraceListener()); // Or write log to the Output window and .NET trace listeners: ComponentPro.Diagnostics.XTrace.Default.Listeners.Add(new ComponentPro.Diagnostics.UltimateOutputTraceListener());