org.apache.log.output.net

Class SMTPOutputLogTarget

public class SMTPOutputLogTarget extends AbstractOutputTarget

Logkit output target that logs data via SMTP (ie. email, email gateways).

Since: 1.1.0

Version: CVS $Id: SMTPOutputLogTarget.java,v 1.6 2003/02/09 23:33:25 mcconnell Exp $

Author: Avalon Development Team Marcus Crafter

Constructor Summary
SMTPOutputLogTarget(Session session, Address[] toAddresses, Address fromAddress, String subject, int maxMsgSize, Formatter formatter)
SMTPOutputLogTarget constructor, creates a logkit output target capable of logging to SMTP (ie. email, email gateway) targets.
Method Summary
voidclose()
Closes this log target.
voidsetDebug(boolean flag)
Method to enable/disable debugging on the mail session.
protected voidwrite(String data)
Method to write data to the log target.

Constructor Detail

SMTPOutputLogTarget

public SMTPOutputLogTarget(Session session, Address[] toAddresses, Address fromAddress, String subject, int maxMsgSize, Formatter formatter)
SMTPOutputLogTarget constructor, creates a logkit output target capable of logging to SMTP (ie. email, email gateway) targets.

Parameters: session mail session to be used toAddresses addresses logs should be sent to fromAddress address logs say they come from subject subject line logs should use maxMsgSize maximum size of any log mail, in units of log events formatter log formatter to use

Method Detail

close

public void close()
Closes this log target. Sends currently buffered message, if existing.

setDebug

public void setDebug(boolean flag)
Method to enable/disable debugging on the mail session.

Parameters: flag true to enable debugging, false to disable it

write

protected void write(String data)
Method to write data to the log target. Logging data is stored in an internal buffer until the size limit is reached. When this happens the data is sent to the SMTP target, and the buffer is reset for subsequent events.

Parameters: data logging data to be written to target