A TraceListener implementation sending all System.Diagnostics.Trace output to the Common.Logging infrastructure.
For a list of all members of this type, see CommonLoggingTraceListener Members .
System.Object
MarshalByRefObject
TraceListener
CommonLoggingTraceListener
Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.
This listener captures all output sent by calls to System.Diagnostics.Trace and and TraceSource and sends it to an ILog instance.
The ILog instance to be used is obtained by calling GetLogger. The name of the logger is created by passing this listener's Name and any source
or category
passed into this listener (see WriteLine or TraceEvent for example).
The snippet below shows how to add and configure this listener to your app.config:
[XML]
<system.diagnostics>
<sharedListeners>
<add name="Diagnostics"
type="Common.Logging.Simple.CommonLoggingTraceListener, Common.Logging"
initializeData="DefaultTraceEventType=Information; LoggerNameFormat={listenerName}.{sourceName}">
<filter type="System.Diagnostics.EventTypeFilter" initializeData="Information"/>
</add>
</sharedListeners>
<trace>
<listeners>
<add name="Diagnostics" />
</listeners>
</trace>
</system.diagnostics>
Namespace: Common.Logging.Simple
Assembly: Common.Logging (in Common.Logging.dll)
CommonLoggingTraceListener Members | Common.Logging.Simple Namespace