public class SmtpManager extends AbstractManager
count, LOGGER
Modifier | Constructor and Description |
---|---|
protected |
SmtpManager(String name,
Session session,
MimeMessage message,
org.apache.logging.log4j.core.net.SmtpManager.FactoryData data) |
Modifier and Type | Method and Description |
---|---|
void |
add(LogEvent event) |
protected void |
encodeContent(byte[] bytes,
String encoding,
ByteArrayOutputStream out) |
protected byte[] |
encodeContentToBytes(byte[] rawBytes,
String encoding) |
protected byte[] |
formatContentToBytes(LogEvent[] priorEvents,
LogEvent appendEvent,
Layout<?> layout) |
protected String |
getEncoding(byte[] rawBytes,
String contentType) |
protected InternetHeaders |
getHeaders(String contentType,
String encoding) |
protected MimeMultipart |
getMimeMultipart(byte[] encodedBytes,
InternetHeaders headers) |
static SmtpManager |
getSmtpManager(Configuration config,
String to,
String cc,
String bcc,
String from,
String replyTo,
String subject,
String protocol,
String host,
int port,
String username,
String password,
boolean isDebug,
String filterName,
int numElements) |
void |
sendEvents(Layout<?> layout,
LogEvent appendEvent)
Send the contents of the cyclic buffer as an e-mail message.
|
protected void |
sendMultipartMessage(MimeMessage msg,
MimeMultipart mp) |
protected void |
writeBuffer(LogEvent[] priorEvents,
LogEvent appendEvent,
Layout<?> layout,
OutputStream out) |
protected void |
writeFooter(Layout<?> layout,
OutputStream out) |
protected void |
writeHeader(Layout<?> layout,
OutputStream out) |
close, getContentFormat, getCount, getLoggerContext, getManager, getName, hasManager, log, logDebug, logError, logger, logWarn, narrow, release, releaseSub, stop, updateData
protected SmtpManager(String name, Session session, MimeMessage message, org.apache.logging.log4j.core.net.SmtpManager.FactoryData data)
public static SmtpManager getSmtpManager(Configuration config, String to, String cc, String bcc, String from, String replyTo, String subject, String protocol, String host, int port, String username, String password, boolean isDebug, String filterName, int numElements)
public void sendEvents(Layout<?> layout, LogEvent appendEvent)
layout
- The layout for formatting the events.appendEvent
- The event that triggered the send.protected byte[] formatContentToBytes(LogEvent[] priorEvents, LogEvent appendEvent, Layout<?> layout) throws IOException
IOException
protected void writeHeader(Layout<?> layout, OutputStream out) throws IOException
IOException
protected void writeBuffer(LogEvent[] priorEvents, LogEvent appendEvent, Layout<?> layout, OutputStream out) throws IOException
IOException
protected void writeFooter(Layout<?> layout, OutputStream out) throws IOException
IOException
protected String getEncoding(byte[] rawBytes, String contentType)
protected byte[] encodeContentToBytes(byte[] rawBytes, String encoding) throws MessagingException, IOException
MessagingException
IOException
protected void encodeContent(byte[] bytes, String encoding, ByteArrayOutputStream out) throws MessagingException, IOException
MessagingException
IOException
protected InternetHeaders getHeaders(String contentType, String encoding)
protected MimeMultipart getMimeMultipart(byte[] encodedBytes, InternetHeaders headers) throws MessagingException
MessagingException
protected void sendMultipartMessage(MimeMessage msg, MimeMultipart mp) throws MessagingException
MessagingException
Copyright © 1999-2019 The 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.