Documentation

July 12, 2017 ยท View on GitHub

Home | Examples | Guidance | FAQ | Listeners | Fluent | Core

Documentation

Examples

Trace ListenersEX

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

Essential.Diagnostics namespace

ClassDescription
BufferedEmailTraceListenerWrites trace events to an Email message sent at the end of the host process.
ColoredConsoleTraceListenerWrites formatted trace events to the console in color based on the type.
EmailTraceListenerWrites trace events to Email messages sent asynchronously.
InMemoryTraceListenerWrites traces to an in-memory array.
RollingFileTraceListenerTrace listener that writes formatted messages to a text file, rolling to a new file based on a filename template (usually including the date).
RollingXmlTraceListenerTrace listener that writes E2ETraceEvent XML fragments to a text file, rolling to a new file based on a filename template (usually including the date).
SeqTraceListenerWrites trace information to a Seq logging server.
SqlDatabaseTraceListenerWrites trace information to a SQL database.

Essential.Diagnostics.FluentEX

Contains the scope utility classes, abstractions, and templated classes for easy use with dependency injection. This package makes using System.Diagnotics trace sources easier, and can be used either separately (with system trace listeners), or in conjunction with the extended trace listeners above.

Essential.Diagnostics namespace

ClassDescription
ActivityScopeSets the correlation ActivityId for the life of the scope object, performs a transfer, and logs activity messages.
LogicalOperationScopeSets the correlation LogicalOperation stack for the life of the scope object.

Essential.Diagnostics.Abstractions namespace

ClassDescription
AssemblyTraceLog<TEventId, TTarget>Implementation of the fluent log interface that is bound to a specific EventId type and with a source named after the target class assembly.
AssemblyTraceSource<TTarget>Enable applications to trace the execution of code and associate trace messages with a source named after the assembly the generic type is from.
GenericEventIdGeneral event IDs.
GenericTraceLogImplementation of TraceLog<TEventId> bound to GenericEventId.
ITraceLog<TEventId>Fluent log interface, with strongly typed event IDs.
ITraceSourceDefines a set of methods and properties that enable applications to trace the execution of code and associate trace messages with their source.
ITraceSource<TTarget>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.
TraceLog<TEventId>Generic implementation of the fluent log interface.
TraceSourceWrapperProvides 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.

Essential.Diagnostics.CoreEX

Core library with base classes, referenced by other packages.

Essential.Diagnostics namespace

ClassDescription
ExpressionFilterFilter events based on an expression.
TraceConfigurationMonitorMonitors the config file for changes are refreshes trace listeners when required.
TraceFormatterInserts trace information into a provided template string. Used to provide the advanced formatting for several listeners.
TraceListenerBaseExtended trace listener designed to be subclassed with as little as a single template method override.

.NET Framework classes

From the Microsoft .NET Framework.

System.Diagnostics namespace

ClassDescription
EventTypeFilterFilters based on the level of the TraceEventType, e.g. Warning, Error, etc.
TraceFilterBase trace filter class provided by the .NET framework.
TraceListenerBase trace listener class provided by the .NET framework.

System Trace Listeners

ClassDescription
ConsoleTraceListenerWrites trace events to the console
DefaultTraceListener
DelimitedListTraceListenerWrites trace events to a file as a delimited list.
DiagnosticMonitorTraceListenerPart of Microsoft.WindowsAzure.Diagnostics; writes traces to Azure logs
EventLogTraceListenerWrites trace events to the Windows Event Log
EventProviderTraceListener
EventSchemaTraceListener
TextWriterTraceListenerWrites trace events to a simple file. Recommended you at least use FileLogTraceListener instead.
WebPageTraceListenerForwards trace events to the ASP.NET trace output.
WMITraceListener^^1^^
XmlWriterTraceListenerWrites events in XML format, suitable for import into the Service Trace Viewer utility.

Microsoft.VisualBasic.Logging namespace

ClassDescription
FileLogTraceListenerWrites trace events to a file with advanced options for file rotation and output format.

Enterprise Library Logging Application Block

ClassDescription
FlatFileTraceListener
FormattedEventLogTraceListener

Note: 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).

Guidance

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

Guidance related to the Essential.Diagnostics project: