@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 {
            throw new UnsupportedOperationException(
                "LogWriterLogger (geode-dunit) does not support LogWriterImpl");
          }
        } catch (GemFireException ex) {
          reportError(null, ex, ErrorManager.WRITE_FAILURE);
        }
      }
    }
Use the log writer to use some of its formatting code.
geode-dunit/src/main/java/org/apache/geode/test/dunit/log4j/LogWriterLogger.java