Class DefaultLevelConverter

  • All Implemented Interfaces:
    LevelConverter

    public class DefaultLevelConverter
    extends java.lang.Object
    implements LevelConverter
    Default implementation of LevelConverter strategy.

    Since 2.4, supports custom JUL levels by mapping them to their closest mapped neighbour.

    Since:
    2.1
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.logging.Level toJavaLevel​(Level level)
      Converts a Log4j logging Level to a JDK logging Level.
      Level toLevel​(java.util.logging.Level javaLevel)
      Converts a JDK logging Level to a Log4j logging Level.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultLevelConverter

        public DefaultLevelConverter()
    • Method Detail

      • toJavaLevel

        public java.util.logging.Level toJavaLevel​(Level level)
        Description copied from interface: LevelConverter
        Converts a Log4j logging Level to a JDK logging Level.
        Specified by:
        toJavaLevel in interface LevelConverter
        Parameters:
        level - Log4j Level to convert.
        Returns:
        converted Level or null if the given level could not be converted.
      • toLevel

        public Level toLevel​(java.util.logging.Level javaLevel)
        Description copied from interface: LevelConverter
        Converts a JDK logging Level to a Log4j logging Level.
        Specified by:
        toLevel in interface LevelConverter
        Parameters:
        javaLevel - JDK Level to convert, may be null per the JUL specification.
        Returns:
        converted Level or null if the given level could not be converted.