Share

smtphandler

Tracker: Patches

1 several changes - ID: 2801730
Last Update: Settings changed ( xmedeko )

Hi,
Hi,

I have made a small change in SMTPHandler.sendBuffer(), so that is somebody
uses a string {0} in the subject, e.g.

smtphandler.subject = Log message {0}

then the {0} is replaced by log level of the las log in the cyclic buffer.

// subject
if (subject != null) {
try {
String levelName = cb.getLastAndKeepIt().getLevel().getName();
msg.setSubject(MessageFormat.format(subject, new Object[]
{levelName}));
} catch (Exception e) {
reportError("Cannot set subject", e, DEFAULT_ERROR_CODE);
}
}

and CyclicBuffer.java:

public LogRecord getLastAndKeepIt()
{
if (numElems <= 0)
return null;

return records[(last - 1) % maxSize];
}


Ondrej Medek ( xmedeko ) - 2009-06-05 13:41

1

Deleted

None

Nobody/Anonymous

None

None

Public


Comment ( 1 )

Date: 2009-06-05 13:42
Sender: xmedeko

This issue was created by mistake.


Attached File

No Files Currently Attached

Changes ( 4 )

Field Old Value Date By
status_id Open 2009-06-05 13:42 xmedeko
priority 5 2009-06-05 13:42 xmedeko
allow_comments 1 2009-06-05 13:42 xmedeko
close_date - 2009-06-05 13:42 xmedeko