@Override
    public void logTemplate(final Severity severity,
                            final Location location,
                            final String elementId,
                            final String messageTemplate,
                            final Throwable e,
                            final Object... messageArgs) {
        // Use trace level as we don't know what level this func is called from
        if (LOGGER.isTraceEnabled()) {
            if ((Object[]) messageArgs == null || messageArgs.length == 0) {
                if (e == null) {
                    LOGGER.trace(messageTemplate);
                } else {
                    LOGGER.trace(messageTemplate, e);
                }
            } else {
                if (e == null) {
                    LOGGER.trace(messageTemplate, messageArgs);
                } else {
                    // Add the ex on the end
                    final Object[] args = Arrays.copyOf(messageArgs, messageArgs.length + 1);
                    args[messageArgs.length] = e;
                    LOGGER.trace(messageTemplate, args);
                }
            }

            if (LOGGER.isTraceEnabled()) {
                LOGGER.trace(e.getMessage(), e);
            }
        }

        if (shouldLog(severity, isTraceEnabled, isIgnoreWarnings)) {
            if (messageTemplate != null && !messageTemplate.isBlank()) {
                messages.add(new LazyMessage(
                        severity,
                        location,
                        elementId,
                        messageTemplate,
                        messageArgs));
            }
        }
    }
Log a message using a template with lazily provided template arguments.
SLF style templating.
stroom-pipeline/src/main/java/stroom/pipeline/refdata/ReferenceDataResult.java