@Plugin(name="SMTPx", category="Core", elementType="appender", printObject=true) public final class ExtendedSmtpAppender extends org.apache.logging.log4j.core.appender.AbstractAppender
SmtpAppender,
createAppender(String, String, String, String, String, String, String, boolean, String, String, int, String, String, boolean, int, Layout, Filter, boolean, int, char, boolean, int, boolean, boolean, boolean, boolean),
ExtendedSmtpManagerorg.apache.logging.log4j.core.appender.AbstractAppender.Builder<B extends org.apache.logging.log4j.core.appender.AbstractAppender.Builder<B>>org.apache.logging.log4j.core.LifeCycle.StateDEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGERELEMENT_TYPE| Modifier and Type | Method and Description |
|---|---|
void |
append(org.apache.logging.log4j.core.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 ExtendedSmtpAppender |
createAppender(String name,
String to,
String cc,
String bcc,
String from,
String replyTo,
String subject,
boolean subjectWithLayout,
String smtpProtocol,
String smtpHost,
int smtpPort,
String smtpUsername,
String smtpPassword,
boolean smtpDebug,
int bufferSize,
org.apache.logging.log4j.core.Layout<? extends Serializable> layout,
org.apache.logging.log4j.core.Filter filter,
boolean ignoreExceptions,
int burstSummarizingSeconds,
char bsCountInSubject,
boolean bsLoggername,
int bsMessagePrefixLength,
boolean bsMessageMaskDigits,
boolean bsExceptionClass,
boolean bsExceptionOrigin,
boolean bsRootExceptionClass)
Create an ExtendedSmtpAppender.
|
boolean |
isFiltered(org.apache.logging.log4j.core.LogEvent event)
Capture all events in CyclicBuffer.
|
void |
stop() |
error, error, error, getHandler, getLayout, getName, ignoreExceptions, parseInt, setHandler, toSerializable, toStringaddFilter, getFilter, hasFilter, removeFilter, start, stop, stopequalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetState, initialize, isStarted, isStopped, start@PluginFactory public static ExtendedSmtpAppender createAppender(@PluginAttribute(value="name") @Required(message="SMTP.name is missing") String name, @PluginAttribute(value="to") String to, @PluginAttribute(value="cc") String cc, @PluginAttribute(value="bcc") String bcc, @PluginAttribute(value="from") @Required(message="SMTP.from is missing") String from, @PluginAttribute(value="replyTo") String replyTo, @PluginAttribute(value="subject") @Required(message="SMTP.subject is missing") String subject, @PluginAttribute(value="subjectWithLayout") boolean subjectWithLayout, @PluginAttribute(value="smtpProtocol",defaultString="smtp") String smtpProtocol, @PluginAttribute(value="smtpHost") @Required(message="SMTP.smtpHost is missing") String smtpHost, @PluginAttribute(value="smtpPort",defaultInt=25) int smtpPort, @PluginAttribute(value="smtpUsername") String smtpUsername, @PluginAttribute(value="smtpPassword") String smtpPassword, @PluginAttribute(value="smtpDebug") boolean smtpDebug, @PluginAttribute(value="bufferSize",defaultInt=10) int bufferSize, @PluginElement(value="Layout") org.apache.logging.log4j.core.Layout<? extends Serializable> layout, @PluginElement(value="Filter") org.apache.logging.log4j.core.Filter filter, @PluginAttribute(value="ignoreExceptions",defaultBoolean=true) boolean ignoreExceptions, @PluginAttribute(value="burstSummarizingSeconds") int burstSummarizingSeconds, @PluginAttribute(value="bsCountInSubject") char bsCountInSubject, @PluginAttribute(value="bsLoggername") boolean bsLoggername, @PluginAttribute(value="bsMessagePrefixLength",defaultInt=30) int bsMessagePrefixLength, @PluginAttribute(value="bsMessageMaskDigits") boolean bsMessageMaskDigits, @PluginAttribute(value="bsExceptionClass",defaultBoolean=true) boolean bsExceptionClass, @PluginAttribute(value="bsExceptionOrigin") boolean bsExceptionOrigin, @PluginAttribute(value="bsRootExceptionClass") boolean bsRootExceptionClass)
name - The name of the Appender. Required.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. Required.replyTo - The comma-separated list of reply-to email addresses.subject - The subject as plain text or as pattern for PatternLayout (see subjectWithLayout). Required.subjectWithLayout - If true, the subject is used as pattern for PatternLayout; default is false.smtpProtocol - The SMTP transport protocol (such as "smtps", defaults to "smtp").smtpHost - The SMTP hostname to send to. Required.smtpPort - The SMTP port to send to; default: 25.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.bufferSize - How many log events should be buffered for inclusion in the message? Default is 10.layout - The layout to use (defaults to HtmlLayout).filter - The Filter or null (defaults to ThresholdFilter, level of ERROR).ignoreExceptions - If "true" (the default) exceptions encountered when appending events are logged;
otherwise they are propagated to the caller.burstSummarizingSeconds - Number of seconds to summarize similar log messages over.
<= 0 to disable this feature (the default).bsCountInSubject - Shall the number of summarized events be put in the subject?
'F' or 'S' for at front/start, 'B' or 'E' for behind/at end;
default is no count in subject.bsLoggername - For summarizing the logger name is relevant; default: false.bsMessagePrefixLength - For summarizing this number of characters from the beginning of the message text are relevant; default: 30.bsMessageMaskDigits - For summarizing, digits in the message text shall be masked, so their concrete value is irrelevant; default: false.bsExceptionClass - For summarizing the exception class name is relevant; default: true.bsExceptionOrigin - For summarizing the first line of the exception stack trace is relevant; default: false.bsRootExceptionClass - For summarizing the class name of the root cause is relevant; default: false.public void stop()
stop in interface org.apache.logging.log4j.core.LifeCyclestop in class org.apache.logging.log4j.core.AbstractLifeCyclepublic boolean isFiltered(org.apache.logging.log4j.core.LogEvent event)
isFiltered in interface org.apache.logging.log4j.core.filter.FilterableisFiltered in class org.apache.logging.log4j.core.filter.AbstractFilterableevent - The Log event.public void append(org.apache.logging.log4j.core.LogEvent event)
event - The Log event.Copyright © 2018. All rights reserved.