org.apache.log.output.net
Class SMTPOutputLogTarget
java.lang.Object
|
+--org.apache.log.output.AbstractTarget
|
+--org.apache.log.output.AbstractOutputTarget
|
+--org.apache.log.output.net.SMTPOutputLogTarget
- All Implemented Interfaces:
- ErrorAware, LogTarget
- 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.html,v 1.1 2003/10/29 14:35:45 leosimons Exp $
- Author:
- Avalon Development Team, Marcus Crafter
Method Summary |
void |
close()
Closes this log target. |
void |
setDebug(boolean flag)
Method to enable/disable debugging on the mail session. |
protected void |
write(String data)
Method to write data to the log target. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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 usedtoAddresses
- addresses logs should be sent tofromAddress
- address logs say they come fromsubject
- subject line logs should usemaxMsgSize
- maximum size of any log mail, in units of log eventsformatter
- log formatter to use
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.
- Overrides:
write
in class AbstractOutputTarget
- Parameters:
data
- logging data to be written to target
close
public void close()
- Closes this log target. Sends currently buffered message, if existing.
- Overrides:
close
in class AbstractOutputTarget
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
Copyright © 2001 Apache Jakarta Project. All Rights Reserved.