|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.log.output.AbstractTarget
org.apache.log.output.AbstractOutputTarget
org.apache.log.output.net.SMTPOutputLogTarget
Logkit output target that logs data via SMTP.
Field Summary | |
private java.lang.StringBuffer |
m_buffer
Buffer containing current mail. |
private long |
m_bufferTime
The time that the first log entry in the current buffer arrived. |
private Address |
m_fromAddress
Address to mail is to be listed as sent from. |
private long |
m_maxDelayTime
The maximun delay that a message will be allowed to wait in the queue before being sent. |
private int |
m_maxMsgSize
Maximum size of mail, in units of log events. |
private Message |
m_message
Message to be sent. |
private int |
m_msgSize
Current size of mail, in units of log events. |
private java.lang.Thread |
m_runner
Runner thread which is responsible for sending batched log entries in the background. |
private Session |
m_session
Mail session. |
private boolean |
m_shutdown
Flag which will be set in the close method when it is time to shutdown. |
private java.lang.String |
m_subject
Mail subject. |
private Address[] |
m_toAddresses
Address to sent mail to. |
Fields inherited from class org.apache.log.output.AbstractOutputTarget |
|
Fields inherited from class org.apache.log.output.AbstractTarget |
|
Constructor Summary | |
SMTPOutputLogTarget(Session session,
Address[] toAddresses,
Address fromAddress,
java.lang.String subject,
int maxMsgSize,
Formatter formatter)
SMTPOutputLogTarget constructor. |
|
SMTPOutputLogTarget(Session session,
Address[] toAddresses,
Address fromAddress,
java.lang.String subject,
int maxMsgSize,
int maxDelayTime,
Formatter formatter)
SMTPOutputLogTarget constructor. |
Method Summary | |
void |
close()
Closes this log target. |
private void |
send()
Helper method to send the currently buffered message, if existing. |
void |
setDebug(boolean flag)
Method to enable/disable debugging on the mail session. |
protected void |
write(java.lang.String data)
Method to write data to the log target. |
Methods inherited from class org.apache.log.output.AbstractOutputTarget |
doProcessEvent, getFormatter, open |
Methods inherited from class org.apache.log.output.AbstractTarget |
getErrorHandler, isOpen, processEvent, setErrorHandler |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private final Session m_session
private Message m_message
private final Address[] m_toAddresses
private final Address m_fromAddress
private final java.lang.String m_subject
private int m_msgSize
private final int m_maxMsgSize
private java.lang.StringBuffer m_buffer
private long m_bufferTime
private long m_maxDelayTime
private java.lang.Thread m_runner
private boolean m_shutdown
Constructor Detail |
public SMTPOutputLogTarget(Session session, Address[] toAddresses, Address fromAddress, java.lang.String subject, int maxMsgSize, int maxDelayTime, Formatter formatter)
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 events.
If this is greater than one but maxDelayTime is 0 then
log events may stay queued for a long period of time
if less than the specified number of messages are
logged. Any unset messages will be sent when the
target is closed.maxDelayTime
- specifies the longest delay in seconds that a log
entry will be queued before being sent. Setting
this to a value larger than 0 will cause a
background thread to be used to queue up and send
messages. Ignored if maxMsgSize is 1 or less.formatter
- log formatter to usepublic SMTPOutputLogTarget(Session session, Address[] toAddresses, Address fromAddress, java.lang.String subject, int maxMsgSize, Formatter formatter)
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 events.
Log events may stay queued for a long period of time
if less than the specified number of messages are
logged. Any unset messages will be sent when the
target is closed.formatter
- log formatter to useMethod Detail |
protected void write(java.lang.String data)
write
in class AbstractOutputTarget
data
- logging data to be written to targetpublic void close()
close
in interface Closeable
close
in class AbstractOutputTarget
public void setDebug(boolean flag)
flag
- true to enable debugging, false to disable itprivate void send()
Only called when synchronized.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |