public final class SMTPAppender extends AbstractAppender
The number of logging events delivered in this e-mail depend on the value of
BufferSize option. The
SMTPAppender keeps only the last
BufferSize logging events in its cyclic buffer. This keeps
memory requirements at a reasonable level while still delivering useful
By default, an email message will formatted as HTML. This can be modified by
setting a layout for the appender.
By default, an email message will be sent when an ERROR or higher severity
message is appended. This can be modified by setting a filter for the
|Modifier and Type||Field and Description|
The SMTP Manager
|Modifier and Type||Method and Description|
Perform SMTPAppender specific appending actions, mainly adding the event to a cyclic buffer and checking if the event triggers an e-mail to be sent.
Create a SMTPAppender.
Capture all events in CyclicBuffer.
error, error, error, getHandler, getLayout, getName, ignoreExceptions, isStarted, parseInt, setHandler, start, stop, toString
addFilter, getFilter, hasFilter, removeFilter, startFilter, stopFilter
public static SMTPAppender createAppender(String name, String to, String cc, String bcc, String from, String replyTo, String subject, String smtpProtocol, String smtpHost, String smtpPortStr, String smtpUsername, String smtpPassword, String smtpDebug, String bufferSizeStr, Layout<? extends Serializable> layout, Filter filter, String ignore)
name- The name of the Appender.
to- The comma-separated list of recipient email addresses.
cc- The comma-separated list of CC email addresses.
bcc- The comma-separated list of BCC email addresses.
from- The email address of the sender.
replyTo- The comma-separated list of reply-to email addresses.
subject- The subject of the email message.
smtpProtocol- The SMTP transport protocol (such as "smtps", defaults to "smtp").
smtpHost- The SMTP hostname to send to.
smtpPortStr- The SMTP port to send to.
smtpUsername- The username required to authenticate against the SMTP server.
smtpPassword- The password required to authenticate against the SMTP server.
smtpDebug- Enable mail session debuging on STDOUT.
bufferSizeStr- How many log events should be buffered for inclusion in the message?
layout- The layout to use (defaults to HTMLLayout).
filter- The Filter or null (defaults to ThresholdFilter, level of ERROR).
"true"(default) exceptions encountered when appending events are logged; otherwise they are propagated to the caller.
public boolean isFiltered(LogEvent event)
Copyright © 1999-2014 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.