@Plugin(name="SMTP", category="Core", elementType="appender", printObject=true) 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
application context.
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
appender.
Modifier and Type | Class and Description |
---|---|
static class |
SmtpAppender.Builder |
LifeCycle.State
DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER
Modifier and Type | Method and Description |
---|---|
void |
append(LogEvent event)
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.
|
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)
Deprecated.
|
boolean |
isFiltered(LogEvent event)
Capture all events in CyclicBuffer.
|
static SmtpAppender.Builder |
newBuilder() |
error, error, error, getHandler, getLayout, getName, ignoreExceptions, parseInt, setHandler, toString
addFilter, getFilter, hasFilter, removeFilter, start, stop
equalsImpl, getState, hashCodeImpl, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping
@PluginBuilderFactory public static SmtpAppender.Builder newBuilder()
@Deprecated 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)
public boolean isFiltered(LogEvent event)
isFiltered
in interface Filterable
isFiltered
in class AbstractFilterable
event
- The Log event.Copyright © 1999-2021 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.