Class MailManager
java.lang.Object
org.apache.logging.log4j.core.appender.AbstractManager
org.apache.logging.log4j.core.net.MailManager
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
SmtpManager
Parent of all managers that send e-mails.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.apache.logging.log4j.core.appender.AbstractManager
AbstractManager.AbstractFactoryData
-
Field Summary
Fields inherited from class org.apache.logging.log4j.core.appender.AbstractManager
count, LOGGER
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
Adds an event to the cyclic buffer.(package private) static String
createManagerName
(String to, String cc, String bcc, String from, String replyTo, String subject, String smtpProtocol, String smtpHost, int smtpPort, String smtpUsername, boolean smtpDebug, String filterName) Creates a unique-per-configuration name for an smtp manager using the specified the parameters.
Using such a name allows us to maintain singletons per unique configurations.abstract void
sendEvents
(Layout<?> layout, LogEvent appendEvent) Send the contents of the cyclic buffer as an e-mail message.Methods inherited from class org.apache.logging.log4j.core.appender.AbstractManager
close, getContentFormat, getCount, getLoggerContext, getManager, getName, getStrSubstitutor, hasManager, log, logDebug, logError, logger, logWarn, narrow, release, releaseSub, stop, updateData
-
Constructor Details
-
MailManager
-
-
Method Details
-
createManagerName
static String createManagerName(String to, String cc, String bcc, String from, String replyTo, String subject, String smtpProtocol, String smtpHost, int smtpPort, String smtpUsername, boolean smtpDebug, String filterName) Creates a unique-per-configuration name for an smtp manager using the specified the parameters.
Using such a name allows us to maintain singletons per unique configurations.- Returns:
- smtp manager name
-
add
Adds an event to the cyclic buffer.- Parameters:
event
- The event to add.
-
sendEvents
Send the contents of the cyclic buffer as an e-mail message.- Parameters:
layout
- The layout for formatting the events.appendEvent
- The event that triggered the send.
-