@Override
    public void log(final Severity severity,
                    final Location location,
                    final String elementId,
                    final String message,
                    final ErrorType errorType,
                    final Throwable e) {

        final String msg = MessageUtil.getMessage(message, e);

        // Record the number of errors.
        StoredErrorStats stats = statsMap.get(severity);
        if (stats == null) {
            stats = new StoredErrorStats(Severity.FATAL_ERROR.equals(severity));
            statsMap.put(severity, stats);
        }
        stats.increment();

        // Only store this message for the current record if one hasn't been
        // stored already.
        final StoredError storedError = new StoredError(severity, location, elementId, msg, errorType);
        if (stats.getCurrentError() == null) {
            stats.setCurrentError(storedError);
        }

        // Store an indicator.
//        indicatorsMap.computeIfAbsent(elementId, k -> new Indicators())
//                        .add(storedError);
        indicatorsMap.computeIfAbsent(elementId, k -> new ConcurrentHashMap<>())
                .computeIfAbsent(storedError.getErrorType(), k -> new Indicators())
                .add(storedError);
    }
Implements a SAX error handler for logging all errors to log4j.
stroom-pipeline/src/main/java/stroom/pipeline/errorhandler/LoggingErrorReceiver.java