Holger's
Java API

com.antelmann.util.logging
Class EmailWriter

java.lang.Object
  extended by com.antelmann.util.logging.AbstractLogWriter<String>
      extended by com.antelmann.util.logging.XMLLogWriter
          extended by com.antelmann.util.logging.EmailWriter
All Implemented Interfaces:
Filter<LogEntry>, LogWriter, Closeable

public class EmailWriter
extends XMLLogWriter

uses email to send each LogEntry object over the Internet. The body of each email message uses the XML format of the super class. As sending the email may take some time, you should consider using an AsynchLogWriter with this EmailWriter.

Author:
Holger Antelmann
See Also:
AsynchLogWriter, EmailAccount

Field Summary
static String subjectLine
           
 
Fields inherited from class com.antelmann.util.logging.AbstractLogWriter
filter
 
Constructor Summary
EmailWriter(EmailAccount service, String toAddress)
           
 
Method Summary
 void write(LogEntry entry)
          sends the email
 
Methods inherited from class com.antelmann.util.logging.XMLLogWriter
close, flush, getAlwaysFlush, getPrintStream, getPrintWriter, setAlwaysFlush, writeLogPattern
 
Methods inherited from class com.antelmann.util.logging.AbstractLogWriter
accept, getLogFilter, getLogFormatter, setLogFilter, setLogFormatter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

subjectLine

public static final String subjectLine
See Also:
Constant Field Values
Constructor Detail

EmailWriter

public EmailWriter(EmailAccount service,
                   String toAddress)
Method Detail

write

public void write(LogEntry entry)
           throws LogException
sends the email

Specified by:
write in interface LogWriter
Overrides:
write in class AbstractLogWriter<String>
Throws:
LogException - if an error occurred while writing the log


(c) 2001-2006 Holger Antelmann - all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads