private String getMessage(final LogRecord record) {
    StringBuilder stringBuilder = new StringBuilder();
    stringBuilder.append('(').append("tid=").append(record.getThreadID())
        .append(" msgId=").append(record.getSequenceNumber()).append(") ");
    if (record.getMessage() != null) {
      stringBuilder.append(getFormatter().formatMessage(record));
    }
    return stringBuilder.toString();
  }
Use the log writer to use some of its formatting code.
geode-core/src/main/java/org/apache/geode/internal/logging/GemFireHandler.java