Class LevelTranslator


  • public final class LevelTranslator
    extends Object
    Utility class to convert between JDK Levels and Log4j 2 Levels.
    Since:
    2.1
    • Field Detail

      • FINEST

        public static final Level FINEST
        Custom Log4j level corresponding to the Level.FINEST logging level. This maps to a level more specific than Level.TRACE.
    • Method Detail

      • toLevel

        public static Level toLevel​(Level level)
        Converts a JDK logging Level to a Log4j logging Level.
        Parameters:
        level - JDK Level to convert, may be null per the JUL specification.
        Returns:
        converted Level or null
      • toJavaLevel

        public static Level toJavaLevel​(Level level)
        Converts a Log4j logging Level to a JDK logging Level.
        Parameters:
        level - Log4j Level to convert.
        Returns:
        converted Level.