| Modifier and Type | Field and Description |
|---|---|
| private StringBuffer | m_buffer
Buffer containing current mail. |
| private long | m_bufferTime
The time that the first log entry in the current buffer arrived. |
| private boolean | m_debug
Flag which controls whether debug is enabled for each message. |
| private final 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 final 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 Thread | m_runner
Runner thread which is responsible for sending batched log entries in the background. |
| private final 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 final String | m_subject
Mail subject. |
| private final Address[] | m_toAddresses
Address to sent mail to. |
| Access | Constructor and Description |
|---|---|
| public | SMTPOutputLogTarget(final Session
mail session to be used session, final Address[] addresses logs should be sent to toAddresses, final Address address logs say they come from fromAddress, final String subject line logs should use subject, final int 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. maxMsgSize, final int 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. maxDelayTime, final Formatter log formatter to use formatter)SMTPOutputLogTarget constructor. |
| public | SMTPOutputLogTarget(final Session
mail session to be used session, final Address[] addresses logs should be sent to toAddresses, final Address address logs say they come from fromAddress, final String subject line logs should use subject, final int 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. maxMsgSize, final Formatter log formatter to use formatter)SMTPOutputLogTarget constructor. |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized void | close()
Overrides org. Implements org. |
| private void | |
| public void | setDebug(boolean
true to enable debugging, false to disable it debug)Method to enable/disable debugging on the mail session. |
| protected synchronized void |
| m_buffer | back to summary |
|---|---|
| private StringBuffer m_buffer Buffer containing current mail. | |
| m_bufferTime | back to summary |
|---|---|
| private long m_bufferTime The time that the first log entry in the current buffer arrived. | |
| m_debug | back to summary |
|---|---|
| private boolean m_debug Flag which controls whether debug is enabled for each message. | |
| m_fromAddress | back to summary |
|---|---|
| private final Address m_fromAddress Address to mail is to be listed as sent from. | |
| m_maxDelayTime | back to summary |
|---|---|
| private long m_maxDelayTime The maximun delay that a message will be allowed to wait in the queue before being sent. | |
| m_maxMsgSize | back to summary |
|---|---|
| private final int m_maxMsgSize Maximum size of mail, in units of log events. | |
| m_message | back to summary |
|---|---|
| private Message m_message Message to be sent. | |
| m_msgSize | back to summary |
|---|---|
| private int m_msgSize Current size of mail, in units of log events. | |
| m_runner | back to summary |
|---|---|
| private Thread m_runner Runner thread which is responsible for sending batched log entries in the background. | |
| m_session | back to summary |
|---|---|
| private final Session m_session Mail session. | |
| m_shutdown | back to summary |
|---|---|
| private boolean m_shutdown Flag which will be set in the close method when it is time to shutdown. | |
| m_subject | back to summary |
|---|---|
| private final String m_subject Mail subject. | |
| m_toAddresses | back to summary |
|---|---|
| private final Address[] m_toAddresses Address to sent mail to. | |
| SMTPOutputLogTarget | back to summary |
|---|---|
| public SMTPOutputLogTarget(final Session session, final Address[] toAddresses, final Address fromAddress, final String subject, final int maxMsgSize, final int maxDelayTime, final Formatter formatter) SMTPOutputLogTarget constructor. It creates a logkit output target capable of logging to SMTP (ie. email, email gateway) targets.
| |
| SMTPOutputLogTarget | back to summary |
|---|---|
| public SMTPOutputLogTarget(final Session session, final Address[] toAddresses, final Address fromAddress, final String subject, final int maxMsgSize, final Formatter formatter) SMTPOutputLogTarget constructor. It creates a logkit output target capable of logging to SMTP (ie. email, email gateway) targets.
| |
| close | back to summary |
|---|---|
| public synchronized void close() Overrides org. Implements org. Closes this log target. Sends currently buffered message, if existing. | |
| send | back to summary |
|---|---|
| private void send() Helper method to send the currently buffered message, if existing. Only called when synchronized. | |
| setDebug | back to summary |
|---|---|
| public void setDebug(boolean debug) Method to enable/disable debugging on the mail session.
| |
| write | back to summary |
|---|---|
| protected synchronized void write(final String data) Overrides org. 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.
| |