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

public abstract class MailManager extends AbstractManager
Parent of all managers that send e-mails.
  • Constructor Details

  • 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

      public abstract void add(LogEvent event)
      Adds an event to the cyclic buffer.
      Parameters:
      event - The event to add.
    • sendEvents

      public abstract void sendEvents(Layout<?> layout, LogEvent appendEvent)
      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.