class HealthCheckEventLogger {

    public void logException(ApplicationException exception, String message) {
        LOG.warn(message, exception);

        if (exception.isAudited() || !exception.requiresAuditing()) {
            return;
        }

        Map<EventDetailsKey, String> details = Map.of(
                downstream_uri, exception.getUri().orElse(URI.create("uri-not-present")).toASCIIString(),
                EventDetailsKey.message, exception.getMessage());

        EventSinkHubEvent hubEvent = new EventSinkHubEvent(serviceInfo, NO_SESSION_CONTEXT_IN_ERROR, ERROR_EVENT, details);
        eventSinkProxy.logHubEvent(hubEvent);
        eventEmitter.record(hubEvent);
    }

    @Inject public  HealthCheckEventLogger(EventSinkProxy eventSinkProxy,
                                  EventEmitter eventEmitter,
                                  ServiceInfoConfiguration serviceInfo);

}