public static void doLog(
        @NotNull String action,
        @Nullable String image,
        @Nullable String containerId,
        @NotNull DockerCmd<?> cmd,
        @Nullable Exception e
    ) {
        if (!log.isTraceEnabled()) {
            return;
        }

        MDC.put(MDC_PREFIX + ".Action", Strings.nullToEmpty(action));
        MDC.put(MDC_PREFIX + ".Image", Strings.nullToEmpty(image));
        MDC.put(MDC_PREFIX + ".ContainerId", Strings.nullToEmpty(containerId));

        try {
            MDC.put(MDC_PREFIX + ".Command", objectMapper.writeValueAsString(cmd));
        } catch (JsonProcessingException ignored) {}

        if (e != null) {
            MDC.put(MDC_PREFIX + ".Exception", e.getLocalizedMessage());
            log.trace("{} action with image: {}, containerId: {}", action, image, containerId, e);
        } else {
            log.trace("{} action with image: {}, containerId: {}", action, image, containerId);
        }

        MDC.remove(MDC_PREFIX + ".Action");
        MDC.remove(MDC_PREFIX + ".Image");
        MDC.remove(MDC_PREFIX + ".ContainerId");
        MDC.remove(MDC_PREFIX + ".Command");
        MDC.remove(MDC_PREFIX + ".Exception");
    }
Logger for tracking potentially destructive actions, intended for usage in a shared Docker environment where
traceability is needed. This class uses SLF4J, logging at TRACE level and capturing common fields as MDC fields.
<p>
Users should configure their test logging to apply appropriate filters/storage so that these logs are
captured appropriately.
core/src/main/java/org/testcontainers/utility/AuditLogger.java