Class FormattedTextWriterTraceListener
- Assembly
- Microsoft.Practices.EnterpriseLibrary.Logging.dll
Extends TextWriterTraceListener to add formatting capabilities.
public class FormattedTextWriterTraceListener : TextWriterTraceListener, IDisposable
- Inheritance
-
FormattedTextWriterTraceListener
- Implements
- Derived
- Inherited Members
Constructors
FormattedTextWriterTraceListener()
Initializes a new instance of FormattedTextWriterTraceListener.
public FormattedTextWriterTraceListener()
FormattedTextWriterTraceListener(ILogFormatter)
Initializes a new instance of FormattedTextWriterTraceListener with a ILogFormatter.
public FormattedTextWriterTraceListener(ILogFormatter formatter)
Parameters
formatter
ILogFormatterThe formatter to format the messages.
FormattedTextWriterTraceListener(Stream)
Initializes a new instance of FormattedTextWriterTraceListener with a Stream.
public FormattedTextWriterTraceListener(Stream stream)
Parameters
stream
StreamThe stream to write to.
FormattedTextWriterTraceListener(Stream, ILogFormatter)
Initializes a new instance of FormattedTextWriterTraceListener with a ILogFormatter and a Stream.
public FormattedTextWriterTraceListener(Stream stream, ILogFormatter formatter)
Parameters
stream
StreamThe stream to write to.
formatter
ILogFormatterThe formatter to format the messages.
FormattedTextWriterTraceListener(Stream, string)
Initializes a new named instance of FormattedTextWriterTraceListener with a Stream.
public FormattedTextWriterTraceListener(Stream stream, string name)
Parameters
FormattedTextWriterTraceListener(Stream, string, ILogFormatter)
Initializes a new named instance of FormattedTextWriterTraceListener with a ILogFormatter and a Stream.
public FormattedTextWriterTraceListener(Stream stream, string name, ILogFormatter formatter)
Parameters
stream
StreamThe stream to write to.
name
stringThe name.
formatter
ILogFormatterThe formatter to format the messages.
FormattedTextWriterTraceListener(TextWriter)
Initializes a new instance of FormattedTextWriterTraceListener with a TextWriter.
public FormattedTextWriterTraceListener(TextWriter writer)
Parameters
writer
TextWriterThe writer to write to.
FormattedTextWriterTraceListener(TextWriter, ILogFormatter)
Initializes a new instance of FormattedTextWriterTraceListener with a ILogFormatter and a TextWriter.
public FormattedTextWriterTraceListener(TextWriter writer, ILogFormatter formatter)
Parameters
writer
TextWriterThe writer to write to.
formatter
ILogFormatterThe formatter to format the messages.
FormattedTextWriterTraceListener(TextWriter, string)
Initializes a new named instance of FormattedTextWriterTraceListener with a TextWriter.
public FormattedTextWriterTraceListener(TextWriter writer, string name)
Parameters
writer
TextWriterThe writer to write to.
name
stringThe name.
FormattedTextWriterTraceListener(TextWriter, string, ILogFormatter)
Initializes a new named instance of FormattedTextWriterTraceListener with a ILogFormatter and a TextWriter.
public FormattedTextWriterTraceListener(TextWriter writer, string name, ILogFormatter formatter)
Parameters
writer
TextWriterThe writer to write to.
name
stringThe name.
formatter
ILogFormatterThe formatter to format the messages.
FormattedTextWriterTraceListener(string)
Initializes a new instance of FormattedTextWriterTraceListener with a file name.
public FormattedTextWriterTraceListener(string fileName)
Parameters
fileName
stringThe file name to write to.
FormattedTextWriterTraceListener(string, ILogFormatter)
Initializes a new instance of FormattedTextWriterTraceListener with a ILogFormatter and a file name.
public FormattedTextWriterTraceListener(string fileName, ILogFormatter formatter)
Parameters
fileName
stringThe file name to write to.
formatter
ILogFormatterThe formatter to format the messages.
FormattedTextWriterTraceListener(string, string)
Initializes a new named instance of FormattedTextWriterTraceListener with a ILogFormatter and a file name.
public FormattedTextWriterTraceListener(string fileName, string name)
Parameters
FormattedTextWriterTraceListener(string, string, ILogFormatter)
Initializes a new named instance of FormattedTextWriterTraceListener with a ILogFormatter and a file name.
public FormattedTextWriterTraceListener(string fileName, string name, ILogFormatter formatter)
Parameters
fileName
stringThe file name to write to.
name
stringThe name.
formatter
ILogFormatterThe formatter to format the messages.
Properties
Formatter
Gets the ILogFormatter used to format the trace messages.
public ILogFormatter Formatter { get; set; }
Property Value
Methods
GetSupportedAttributes()
Declares "formatter" as a supported attribute name.
protected override string[] GetSupportedAttributes()
Returns
- string[]
TraceData(TraceEventCache, string, TraceEventType, int, object)
Intercepts the tracing request to format the object to trace.
public override void TraceData(TraceEventCache eventCache, string source, TraceEventType eventType, int id, object data)
Parameters
eventCache
TraceEventCacheThe context information.
source
stringThe trace source.
eventType
TraceEventTypeThe severity.
id
intThe event id.
data
objectThe object to trace.
Remarks
Formatting is only performed if the object to trace is a LogEntry and the formatter is set.