Sends logging events to a TextWriter.
Inheritance Hierarchy
log4net.AppenderAppenderSkeleton
log4net.AppenderTextWriterAppender
log4net.AppenderFileAppender
Namespace: log4net.Appender
Assembly: log4net (in log4net.dll) Version: 2.0.8.0-.NET 4.0
Syntax
The TextWriterAppender type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| TextWriterAppender |
Initializes a new instance of the TextWriterAppender class.
| |
| TextWriterAppender(ILayout, Stream) | Obsolete.
Initializes a new instance of the TextWriterAppender class and
sets the output destination to a new StreamWriter initialized
with the specified Stream.
| |
| TextWriterAppender(ILayout, TextWriter) | Obsolete.
Initializes a new instance of the TextWriterAppender class and sets
the output destination to the specified StreamWriter.
|
Properties
| Name | Description | |
|---|---|---|
| ErrorHandler |
Gets or set the IErrorHandler and the underlying
QuietTextWriter, if any, for this appender.
(Overrides AppenderSkeletonErrorHandler.) | |
| FilterHead |
The filter chain.
(Inherited from AppenderSkeleton.) | |
| ImmediateFlush |
Gets or set whether the appender will flush at the end
of each append operation.
| |
| Layout |
Gets or sets the ILayout for this appender.
(Inherited from AppenderSkeleton.) | |
| Name |
Gets or sets the name of this appender.
(Inherited from AppenderSkeleton.) | |
| QuietWriter |
Gets or sets the QuietTextWriter where logging events
will be written to.
| |
| RequiresLayout |
This appender requires a log4net.Layout to be set.
(Overrides AppenderSkeletonRequiresLayout.) | |
| Threshold |
Gets or sets the threshold Level of this appender.
(Inherited from AppenderSkeleton.) | |
| Writer |
Sets the TextWriter where the log output will go.
|
Methods
| Name | Description | |
|---|---|---|
| ActivateOptions |
Initialize the appender based on the options set
(Inherited from AppenderSkeleton.) | |
| AddFilter |
Adds a filter to the end of the filter chain.
(Inherited from AppenderSkeleton.) | |
| Append(LoggingEvent) |
This method is called by the DoAppend(LoggingEvent)
method.
(Overrides AppenderSkeletonAppend(LoggingEvent).) | |
| Append(LoggingEvent) |
This method is called by the DoAppend(LoggingEvent)
method.
(Overrides AppenderSkeletonAppend(LoggingEvent).) | |
| ClearFilters |
Clears the filter list for this appender.
(Inherited from AppenderSkeleton.) | |
| Close |
Closes the appender and release resources.
(Inherited from AppenderSkeleton.) | |
| CloseWriter |
Closes the underlying TextWriter.
| |
| DoAppend(LoggingEvent) |
Performs threshold checks and invokes filters before
delegating actual logging to the subclasses specific
[M:Append(LoggingEvent)] method.
(Inherited from AppenderSkeleton.) | |
| DoAppend(LoggingEvent) |
Performs threshold checks and invokes filters before
delegating actual logging to the subclasses specific
[M:Append(LoggingEvent[])] method.
(Inherited from AppenderSkeleton.) | |
| Equals | (Inherited from Object.) | |
| FilterEvent |
Test if the logging event should we output by this appender
(Inherited from AppenderSkeleton.) | |
| Finalize |
Finalizes this appender by calling the implementation's
Close method.
(Inherited from AppenderSkeleton.) | |
| Flush |
Flushes any buffered log data.
(Overrides AppenderSkeletonFlush(Int32).) | |
| GetHashCode |
Serves as a hash function for a particular type.
(Inherited from Object.) | |
| GetType |
Gets the Type of the current instance.
(Inherited from Object.) | |
| IsAsSevereAsThreshold |
Checks if the message level is below this appender's threshold.
(Inherited from AppenderSkeleton.) | |
| MemberwiseClone |
Creates a shallow copy of the current Object.
(Inherited from Object.) | |
| OnClose |
Close this appender instance. The underlying stream or writer is also closed.
(Overrides AppenderSkeletonOnClose.) | |
| PreAppendCheck |
This method determines if there is a sense in attempting to append.
(Overrides AppenderSkeletonPreAppendCheck.) | |
| PrepareWriter |
Called to allow a subclass to lazily initialize the writer
| |
| RenderLoggingEvent(LoggingEvent) |
Renders the LoggingEvent to a string.
(Inherited from AppenderSkeleton.) | |
| RenderLoggingEvent(TextWriter, LoggingEvent) |
Renders the LoggingEvent to a string.
(Inherited from AppenderSkeleton.) | |
| Reset |
Clears internal references to the underlying TextWriter
and other variables.
| |
| ToString | (Inherited from Object.) | |
| WriteFooter |
Writes a footer as produced by the embedded layout's Footer property.
| |
| WriteFooterAndCloseWriter |
Writes the footer and closes the underlying TextWriter.
| |
| WriteHeader |
Writes a header produced by the embedded layout's Header property.
|
Remarks
An Appender that writes to a TextWriter.
This appender may be used stand alone if initialized with an appropriate writer, however it is typically used as a base class for an appender that can open a TextWriter to write to.
See Also