@Override
  public void publish(final LogRecord record) {
    if (isLoggable(record)) {
      try {
        if (logWriter instanceof LogWriterLogger) {
          ((LogWriterLogger) logWriter).log(record.getLevel().intValue(), getMessage(record),
              record.getThrown());
        } else {
          ((LogWriterImpl) logWriter).put(record.getLevel().intValue(), getMessage(record),
              record.getThrown());
        }
      } catch (GemFireException ex) {
        reportError(null, ex, ErrorManager.WRITE_FAILURE);
      }
    }
  }
Use the log writer to use some of its formatting code.
geode-core/src/main/java/org/apache/geode/internal/logging/GemFireHandler.java