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 Level
An extension of the Level class that provides support for java.util.logging Levels.
Author:
Scott Deboy (sdeboy@apache.org)
See Also:
  • 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 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 getAllPossibleLevels()
      Gets list of supported levels.
      Returns:
      list of supported levels.
    • toLevel

      public static 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 Level toLevel(String sArg, 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.