Class UtilLoggingLevel

java.lang.Object
org.apache.log4j.Priority
org.apache.log4j.Level
org.apache.log4j.helpers.UtilLoggingLevel
All Implemented Interfaces:
Serializable

public class UtilLoggingLevel extends org.apache.log4j.Level
An extension of the Level class that provides support for java.util.logging Levels.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final UtilLoggingLevel
    CONFIG.
    static final int
    Numerical value for CONFIG.
    static final UtilLoggingLevel
    FINE.
    static final int
    Numerical value for FINE.
    static final UtilLoggingLevel
    FINER.
    static final int
    Numerical value for FINER.
    static final UtilLoggingLevel
    FINEST.
    static final int
    Numerical value for FINEST.
    static final UtilLoggingLevel
    INFO.
    private static final long
    Serialization version id.
    static final UtilLoggingLevel
    SEVERE.
    static final int
    Numerical value for SEVERE.
    static final int
    Numerical value for UNKNOWN.
    static final UtilLoggingLevel
    WARNING.
    static final int
    Numerical value for WARNING.

    Fields inherited from class org.apache.log4j.Level

    ALL, DEBUG, ERROR, FATAL, OFF, TRACE, TRACE_INT, WARN

    Fields inherited from class org.apache.log4j.Priority

    ALL_INT, DEBUG_INT, ERROR_INT, FATAL_INT, INFO_INT, OFF_INT, WARN_INT
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    UtilLoggingLevel(int level, String levelStr, int syslogEquivalent)
    Create new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets list of supported levels.
    static org.apache.log4j.Level
    toLevel(int val)
    Gets level matching numeric value.
    toLevel(int val, UtilLoggingLevel defaultLevel)
    Convert an integer passed as argument to a level.
    static org.apache.log4j.Level
    Get level with specified symbolic name.
    static org.apache.log4j.Level
    toLevel(String sArg, org.apache.log4j.Level defaultLevel)
    Get level with specified symbolic name.

    Methods inherited from class org.apache.log4j.Level

    toLevel

    Methods inherited from class org.apache.log4j.Priority

    equals, getAllPossiblePriorities, getSyslogEquivalent, isGreaterOrEqual, toInt, toPriority, toPriority, toPriority, toPriority, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • UtilLoggingLevel

      protected UtilLoggingLevel(int level, String levelStr, int syslogEquivalent)
      Create new instance.
      Parameters:
      level - numeric value for level.
      levelStr - symbolic name for level.
      syslogEquivalent - Equivalent syslog severity.
  • Method Details

    • toLevel

      public static UtilLoggingLevel toLevel(int val, UtilLoggingLevel defaultLevel)
      Convert an integer passed as argument to a level. If the conversion fails, then this method returns the specified default.
      Parameters:
      val - numeric value.
      defaultLevel - level to be returned if no level matches numeric value.
      Returns:
      matching level or default level.
    • toLevel

      public static org.apache.log4j.Level toLevel(int val)
      Gets level matching numeric value.
      Parameters:
      val - numeric value.
      Returns:
      matching level or UtilLoggerLevel.FINEST if no match.
    • getAllPossibleLevels

      public static List<UtilLoggingLevel> getAllPossibleLevels()
      Gets list of supported levels.
      Returns:
      list of supported levels.
    • toLevel

      public static org.apache.log4j.Level toLevel(String s)
      Get level with specified symbolic name.
      Parameters:
      s - symbolic name.
      Returns:
      matching level or Level.DEBUG if no match.
    • toLevel

      public static org.apache.log4j.Level toLevel(String sArg, org.apache.log4j.Level defaultLevel)
      Get level with specified symbolic name.
      Parameters:
      sArg - symbolic name.
      defaultLevel - level to return if no match.
      Returns:
      matching level or defaultLevel if no match.