Class SensitiveLoggingUtils


  • public final class SensitiveLoggingUtils
    extends Object
    Shared policy for rendering sensitive HTTP headers in logs. The policy is read once from the org.asynchttpclient.enableSensitiveLogging system property or AHC_ENABLE_SENSITIVE_LOGGING environment variable when this class is initialized.

    Covers request credential headers only. WWW-Authenticate and Proxy-Authenticate response challenge headers are logged unredacted, and request form/query/multipart/body values are out of scope since they have no reliable generic sensitivity classification.

    • Method Detail

      • isSensitiveHeader

        public static boolean isSensitiveHeader​(CharSequence name)
        Returns whether a header value must be redacted from logs.
        Parameters:
        name - the header name
        Returns:
        true for authentication and cookie headers when sensitive logging is disabled