Class LoggingUtils

java.lang.Object
io.micronaut.security.utils.LoggingUtils

@Internal public final class LoggingUtils extends Object
Utility methods to avoid verbosity of logging statements. Mostly used to help reduce the Cognitive Complexity of some methods.
Author:
Álvaro Sánchez-Mariscal
  • Method Details

    • debug

      public static void debug(org.slf4j.Logger logger, String message, Object... args)
      Logs a message at the DEBUG level (only if it's enabled) according to the specified format and arguments.
      Parameters:
      logger - the SLF4J logger
      message - the format string
      args - a list of arguments
    • logAuthenticationAttributes

      public static void logAuthenticationAttributes(org.slf4j.Logger logger, @Nullable Authentication authentication)
      Logs the attributes of an authentication. At TRACE the attribute values are logged with the token values redacted. At DEBUG only the attribute keys are logged.
      Parameters:
      logger - the SLF4J logger
      authentication - the authentication
      Since:
      5.4.0