Method format
StringBuffer sb = new StringBuffer();
// Get localized message after formatting per resource bundle if any.
String message = formatMessage(record);
sb.append(message);
// Get stack trace if message was a result of exception.
if (record.getThrown() != null) {
try {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
record.getThrown().printStackTrace(pw);
pw.close();
sb.append(lineSeparator);
sb.append(sw.toString());
} catch (Exception ex) {}
}
sb.append(lineSeparator);
return sb.toString();