SmtpPickupDirAppender ClassApache log4net™ SDK Documentation
Send an email when a specific logging event occurs, typically on errors or fatal errors. Rather than sending via smtp it writes a file into the directory specified by PickupDir. This allows services such as the IIS SMTP agent to manage sending the messages.
Inheritance Hierarchy

SystemObject
  log4net.AppenderAppenderSkeleton
    log4net.AppenderBufferingAppenderSkeleton
      log4net.AppenderSmtpPickupDirAppender

Namespace: log4net.Appender
Assembly: log4net (in log4net.dll) Version: 2.0.6.0-.NET 4.0
Syntax

public class SmtpPickupDirAppender : BufferingAppenderSkeleton

The SmtpPickupDirAppender type exposes the following members.

Constructors

  NameDescription
Public methodSmtpPickupDirAppender
Default constructor
Top
Properties

  NameDescription
Public propertyBufferSize
Gets or sets the size of the cyclic buffer used to hold the logging events.
(Inherited from BufferingAppenderSkeleton.)
Public propertyErrorHandler
Gets or sets the IErrorHandler for this appender.
(Inherited from AppenderSkeleton.)
Public propertyEvaluator
Gets or sets the ITriggeringEventEvaluator that causes the buffer to be sent immediately.
(Inherited from BufferingAppenderSkeleton.)
Public propertyFileExtension
Gets or sets the file extension for the generated files
Public propertyFilterHead
The filter chain.
(Inherited from AppenderSkeleton.)
Public propertyFix
Gets or sets a the fields that will be fixed in the event
(Inherited from BufferingAppenderSkeleton.)
Public propertyFrom
Gets or sets the e-mail address of the sender.
Public propertyLayout
Gets or sets the ILayout for this appender.
(Inherited from AppenderSkeleton.)
Public propertyLossy
Gets or sets a value that indicates whether the appender is lossy.
(Inherited from BufferingAppenderSkeleton.)
Public propertyLossyEvaluator
Gets or sets the value of the ITriggeringEventEvaluator to use.
(Inherited from BufferingAppenderSkeleton.)
Public propertyName
Gets or sets the name of this appender.
(Inherited from AppenderSkeleton.)
Public propertyOnlyFixPartialEventData Obsolete.
Gets or sets a value indicating if only part of the logging event data should be fixed.
(Inherited from BufferingAppenderSkeleton.)
Public propertyPickupDir
Gets or sets the path to write the messages to.
Protected propertyRequiresLayout
This appender requires a log4net.Layout to be set.
(Overrides AppenderSkeletonRequiresLayout.)
Public propertySecurityContext
Gets or sets the SecurityContext used to write to the pickup directory.
Public propertySubject
Gets or sets the subject line of the e-mail message.
Public propertyThreshold
Gets or sets the threshold Level of this appender.
(Inherited from AppenderSkeleton.)
Public propertyTo
Gets or sets a semicolon-delimited list of recipient e-mail addresses.
Top
Methods

  NameDescription
Public methodActivateOptions
Activate the options on this appender.
(Overrides BufferingAppenderSkeletonActivateOptions.)
Public methodAddFilter
Adds a filter to the end of the filter chain.
(Inherited from AppenderSkeleton.)
Protected methodAppend(LoggingEvent)
Append a bulk array of logging events.
(Inherited from AppenderSkeleton.)
Protected methodAppend(LoggingEvent)
This method is called by the DoAppend(LoggingEvent) method.
(Inherited from BufferingAppenderSkeleton.)
Public methodClearFilters
Clears the filter list for this appender.
(Inherited from AppenderSkeleton.)
Public methodClose
Closes the appender and release resources.
(Inherited from AppenderSkeleton.)
Protected methodStatic memberConvertToFullPath
Convert a path into a fully qualified path.
Public methodDoAppend(LoggingEvent)
Performs threshold checks and invokes filters before delegating actual logging to the subclasses specific [M:Append(LoggingEvent)] method.
(Inherited from AppenderSkeleton.)
Public methodDoAppend(LoggingEvent)
Performs threshold checks and invokes filters before delegating actual logging to the subclasses specific [M:Append(LoggingEvent[])] method.
(Inherited from AppenderSkeleton.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFilterEvent
Test if the logging event should we output by this appender
(Inherited from AppenderSkeleton.)
Protected methodFinalize
Finalizes this appender by calling the implementation's Close method.
(Inherited from AppenderSkeleton.)
Public methodFlush
Flush the currently buffered events
(Inherited from BufferingAppenderSkeleton.)
Public methodFlush(Boolean)
Flush the currently buffered events
(Inherited from BufferingAppenderSkeleton.)
Public methodFlush(Int32)
Flushes any buffered log data.
(Inherited from BufferingAppenderSkeleton.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodIsAsSevereAsThreshold
Checks if the message level is below this appender's threshold.
(Inherited from AppenderSkeleton.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnClose
Close this appender instance.
(Inherited from BufferingAppenderSkeleton.)
Protected methodPreAppendCheck
Called before [M:Append(LoggingEvent)] as a precondition.
(Inherited from AppenderSkeleton.)
Protected methodRenderLoggingEvent(LoggingEvent)
Renders the LoggingEvent to a string.
(Inherited from AppenderSkeleton.)
Protected methodRenderLoggingEvent(TextWriter, LoggingEvent)
Renders the LoggingEvent to a string.
(Inherited from AppenderSkeleton.)
Protected methodSendBuffer
Sends the contents of the cyclic buffer as an e-mail message.
(Overrides BufferingAppenderSkeletonSendBuffer(LoggingEvent).)
Protected methodSendFromBuffer
Sends the contents of the buffer.
(Inherited from BufferingAppenderSkeleton.)
Public methodToString
Returns a String that represents the current Object.
(Inherited from Object.)
Top
Remarks

The configuration for this appender is identical to that of the SMTPAppender, except that instead of specifying the SMTPAppender.SMTPHost you specify PickupDir.

The number of logging events delivered in this e-mail depend on the value of BufferSize option. The SmtpPickupDirAppender keeps only the last BufferSize logging events in its cyclic buffer. This keeps memory requirements at a reasonable level while still delivering useful application context.

See Also

Reference