code: public String format(LogRecord record) {
          StringBuffer sb = new StringBuffer();
          String message = formatMessage(record);
          sb.append(message);
          sb.append(lineSeparator);
          if (record.getThrown() != null) {
              try {
                  StringWriter sw = new StringWriter();
                  PrintWriter pw = new PrintWriter(sw);
                  record.getThrown().printStackTrace(pw);
                  pw.close();
              sb.append(sw.toString());
              } catch (Exception ex) {
              	if (record.getThrown().getCause() != null){
  					sb.append(record.getThrown().getCause().getLocalizedMessage());
              	}else{
  					sb.append(record.getThrown().getLocalizedMessage());
              	}
              	
              }
          }
          return sb.toString();
      }
docs: /* (non-Javadoc)
  @see java.util.logging.Formatter#format(java.util.logging.LogRecord)