Throwable throwable = record.getThrown(); if (throwable != null) { StringWriter sink = new StringWriter(); throwable.printStackTrace(new PrintWriter(sink, true)); buf.append(sink.toString()); }
  public String format(LogRecord record)  {    StringBuffer buf = new StringBuffer(180);    if (dateFormat == null)      dateFormat = DateFormat.getDateTimeInstance();    buf.append(dateFormat.format(new Date(record.getMillis())));    buf.append(' ');    buf.append(record.getSourceClassName());    buf.append(' ');    buf.append(record.getSourceMethodName());    buf.append(lineSep);    buf.append(record.getLevel());    buf.append(": ");    buf.append(formatMessage(record));    buf.append(lineSep);    return buf.toString();  }