Package ch.k43.util

Klasse KLogSMTPHandler

java.lang.Object
java.util.logging.Handler
ch.k43.util.KLogSMTPHandler

public class KLogSMTPHandler extends Handler
Java logging handler to send logging data to an SMTP host. To avoid a high number of emails sent to the server, only log data of type error SEVERE is sent. Additionally the number of emails per minutes is restricted. The following properties are supported:
 ch.k43.util.KLogSMTPHandler.mail.from = Sender email address
 ch.k43.util.KLogSMTPHandler.mail.to = recipient(s)
 ch.k43.util.KLogSMTPHandler.mail.subject = subject (default "KLog Error Report")
 ch.k43.util.KLogSMTPHandler.smtp.hostname = host name (default MX record of first recipient domain)
 ch.k43.util.KLogSMTPHandler.smtp.hostport = host port (default 25)
 ch.k43.util.KLogSMTPHandler.smtp.username = user name for authentication (default none)
 ch.k43.util.KLogSMTPHandler.smtp.password = user password for authentication (default none)
 ch.k43.util.KLogSMTPHandler.smtp.tls = true/false (default true)
 ch.k43.util.KLogSMTPHandler.threshold = nn (maximum number of emails per minute, 1 to 10, default 3)
 ch.k43.util.KLogSMTPHandler.debug = true/false (Output sent to System.out/System.err, default false)   
 
Seit:
2024.08.26
  • Konstruktordetails

    • KLogSMTPHandler

      public KLogSMTPHandler()
      Class constructor.
  • Methodendetails

    • close

      public void close()
      Close the handler.
      Angegeben von:
      close in Klasse Handler
    • flush

      public void flush()
      Flush the data.
      Angegeben von:
      flush in Klasse Handler
    • publish

      public void publish(LogRecord argRecord)
      Send log record a email to SMTP host.
      Angegeben von:
      publish in Klasse Handler
      Parameter:
      argRecord - Log record
    • toString

      public String toString()
      String representation of object.
      Setzt außer Kraft:
      toString in Klasse Object