@SuppressWarnings("OptionalUsedAsFieldOrParameterType")
    private void logUserIdentityToDebug(final Optional<UserIdentity> optUserIdentity,
                                        final String fullPath,
                                        final String msg) {
        LOGGER.debug("User identity ({}): {} path: {}",
                msg,
                optUserIdentity.map(
                                identity -> {
                                    final String id = identity.getDisplayName() != null
                                            ? identity.getSubjectId() + " (" + identity.getDisplayName() + ")"
                                            : identity.getSubjectId();
                                    return LogUtil.message("'{}' {}",
                                            id,
                                            identity.getClass().getSimpleName());
                                })
                        .orElse("<empty>"),
                fullPath);
    }
Filter to avoid posts to the wrong place (e.g. the root of the app)
stroom-security/stroom-security-impl/src/main/java/stroom/security/impl/SecurityFilter.java