Documentation

 

Examples

Listeners

The following trace listeners are provided by the .NET Framework and the Essential.Diagnostics extensions.

BufferedEmailTraceListenerEX Writes trace events to an Email message sent at the end of the host process.
ColoredConsoleTraceListenerEX Writes formatted trace events to the console in color based on the type.
ConsoleTraceListener Writes trace events to the console
DefaultTraceListener
DelimitedListTraceListener Writes trace events to a file as a delimited list.
DiagnosticMonitorTraceListener Part of Microsoft.WindowsAzure.Diagnostics; writes traces to Azure logs
EmailTraceListenerEX Writes trace events to Email messages sent asynchronously.
EventLogTraceListener Writes trace events to the Windows Event Log
EventProviderTraceListener
EventSchemaTraceListener
FileLogTraceListener Writes trace events to a file with advanced options for file rotation and output format.
FlatFileTraceListener1
FormattedEventLogTraceListener1
InMemoryTraceListenerEX Writes traces to an in-memory array.
RollingFileTraceListenerEX Trace listener that writes formatted messages to a text file, rolling to a new file based on a filename template (usually including the date).
RollingXmlTraceListenerEX Trace listener that writes E2ETraceEvent XML fragments to a text file, rolling to a new file based on a filename template (usually including the date).
SeqTraceListenerEX Writes trace information to a Seq logging server.
SqlDatabaseTraceListenerEX Writes trace information to a SQL database.
TextWriterTraceListener Writes trace events to a simple file. Recommended you at least use FileLogTraceListener instead.
WebPageTraceListener Forwards trace events to the ASP.NET trace output.
WMITraceListener1
XmlWriterTraceListener Writes events in XML format, suitable for import into the Service Trace Viewer utility.


Note: 1 These trace listeners from the Enterprise Library Logging Application Block can also be used directly with System.Diagnostics (for details see http://msdn.microsoft.com/en-us/library/ff664735%28v=PandP.50%29.aspx).

Filters

EventTypeFilter Filters based on the level of the TraceEventType, e.g. Warning, Error, etc.
ExpressionFilterEX Filter events based on an expression.
SourceFilter Filters based on the TraceSource that generated the message.

Listener Extensions

TraceFormatterEX Inserts trace information into a provided template string. Used to provide the advanced formatting for several listeners.
TraceConfigurationMonitorEX Monitors the config file for changes are refreshes trace listeners when required.

Tracing Extensions

ActivityScopeEX Sets the correlation ActivityId for the life of the scope object, performs a transfer, and logs activity messages.
LogicalOperationScopeEX Sets the correlation LogicalOperation stack for the life of the scope object.

Diagnostics.Abstractions

AssemblyTraceSource<T>EX Enable applications to trace the execution of code and associate trace messages with a source named after the assembly the generic type is from.
ITraceSourceEX Defines a set of methods and properties that enable applications to trace the execution of code and associate trace messages with their source.
ITraceSource<T>EX Defines a set of methods and properties that enable applications to trace the execution of code and associate trace messages with a source related to a specific class.
TraceSourceWrapperEX Provides a wrapper around TraceSource that implements the ITraceSource interface, enable applications to trace the execution of code and associate trace messages with their source in a decoupled manner.

Base Classes

TraceListener Base trace listener class provided by the .NET framework.
TraceListenerBaseEX Extended trace listener designed to be subclassed with as little as a single template method override.
TraceFilter Base trace filter class provided by the .NET framework.

Guidance

Guidance on considerations when implementing logging and other instrumentation for your project:

Guidance related to the Essential.Diagnostics project:

Last edited Feb 8 at 9:22 AM by sgryphon, version 39

Comments

No comments yet.