@Plugin(name="Mail",
category="Core",
elementType="appender",
printObject=true)
public final class MailAppender
extends AbstractAppender
Compatible with the Apache Log4j 2 SmtpAppender.
Modifier and Type | Method and Description |
---|---|
void |
append(LogEvent event) |
static MailAppender |
createAppender(String name,
String to,
String cc,
String bcc,
String from,
String replyTo,
String subject,
String smtpProtocol,
String smtpHost,
int smtpPort,
String smtpUsername,
String smtpPassword,
boolean smtpDebug,
Filter filter,
TriggeringPolicy policy,
Layout<? extends Serializable> layout,
int bufferSize,
boolean ignoreExceptions)
Create a mail appender.
|
boolean |
isFiltered(LogEvent event) |
error, error, error, getHandler, getLayout, getName, ignoreExceptions, parseInt, setHandler, toString
addFilter, getFilter, hasFilter, removeFilter, start, stop, stop
equalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop, stop
@PluginFactory public static MailAppender createAppender(@PluginAttribute(value="name") String name, @PluginAttribute(value="to") String to, @PluginAttribute(value="cc") String cc, @PluginAttribute(value="bcc") String bcc, @PluginAttribute(value="from") String from, @PluginAttribute(value="replyTo") String replyTo, @PluginAttribute(value="subject") String subject, @PluginAttribute(value="smtpProtocol") String smtpProtocol, @PluginAttribute(value="smtpHost") String smtpHost, @PluginAttribute(value="smtpPort",defaultInt=0) int smtpPort, @PluginAttribute(value="smtpUsername") String smtpUsername, @PluginAttribute(value="smtpPassword") String smtpPassword, @PluginAttribute(value="smtpDebug",defaultBoolean=false) boolean smtpDebug, @PluginElement(value="Filter") Filter filter, @PluginElement(value="Policy") TriggeringPolicy policy, @PluginElement(value="Layout") Layout<? extends Serializable> layout, @PluginAttribute(value="bufferSize",defaultInt=512) int bufferSize, @PluginAttribute(value="ignoreExceptions",defaultBoolean=true) boolean ignoreExceptions)
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.smtpHost
- The SMTP hostname to send to.smtpPort
- The SMTP port to send to.smtpUsername
- The SMTP username.smtpPassword
- The SMTP password.smtpDebug
- Enable mail session debuging on STDOUT.filter
- The filter or null.policy
- The triggering policy or null.layout
- The layout or null.bufferSize
- Log events buffer size.ignoreExceptions
- True ignores exceptions.public void append(LogEvent event)
public boolean isFiltered(LogEvent event)
isFiltered
in interface Filterable
isFiltered
in class AbstractFilterable
Copyright © 2003-2019 Serge Brisson. All Rights Reserved.