Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.log4j
Class Level

    java.lang.Object
      org.apache.log4j.Priority
          org.apache.log4j.Level

All Implemented Interfaces:
  Serializable

    public class Level

extends Priority
implements Serializable

Defines the minimum set of levels recognized by the system, that is `OFF`, `FATAL`, `ERROR`, `WARN`, `INFO`, `DEBUG` and `ALL`.

The `Level` class may be subclassed to define a larger level set.

See Also:
  Serialized Form

Field Summary
`static Level` | `ALL` The `ALL` has the lowest possible rank and is intended to turn on all logging.
`static Level` | `DEBUG` The `DEBUG` Level designates fine-grained informational events that are most useful to debug an application.
`static Level` | `ERROR` The `ERROR` level designates error events that might still allow the application to continue running.
`static Level` | `FATAL` The `FATAL` level designates very severe error events that will presumably lead the application to abort.
`static Level` | `INFO` The `INFO` level designates informational messages that highlight the progress of the application at coarse-grained level.
`static Level` | `OFF` The `OFF` has the highest possible rank and is intended to turn off logging.
`static Level` | `TRACE` The `TRACE` Level designates finer-grained informational events than the `DEBUG` level.
`static int` | `TRACE_INT` TRACE level integer value.
`static Level` | `WARN` The `WARN` level designates potentially harmful situations.

Fields inherited from class org.apache.log4j.Priority
`ALL_INT, DEBUG_INT, ERROR_INT, FATAL_INT, INFO_INT, OFF_INT, WARN_INT`

Constructor Summary
`protected` | `Level(int level, String levelStr, int syslogEquivalent)` Instantiate a Level object.

Method Summary
`protected Object` | `readResolve()` Resolved deserialized level to one of the stock instances.
`static Level` | `toLevel(int val)` Convert an integer passed as argument to a level.
`static Level` | `toLevel(int val, Level defaultLevel)` Convert an integer passed as argument to a level.
`static Level` | `toLevel(String sArg)` Convert the string passed as argument to a level.
`static Level` | `toLevel(String sArg, Level defaultLevel)` Convert the string passed as argument to a level.

Methods inherited from class org.apache.log4j.Priority
`equals, getAllPossiblePriorities, getSyslogEquivalent, hashCode, isGreaterOrEqual, toInt, toPriority, toPriority, toPriority, toPriority, toString`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Field Detail

### TRACE_INT

    public static final int TRACE_INT

  TRACE level integer value.

  Since:
    1.2.12
  See Also:
    Constant Field Values

### OFF

    public static final Level OFF

  The `OFF` has the highest possible rank and is intended to turn off logging.

### FATAL

    public static final Level FATAL

  The `FATAL` level designates very severe error events that will presumably lead the application to abort.

### ERROR

    public static final Level ERROR

  The `ERROR` level designates error events that might still allow the application to continue running.

### WARN

    public static final Level WARN

  The `WARN` level designates potentially harmful situations.

### INFO

    public static final Level INFO

  The `INFO` level designates informational messages that highlight the progress of the application at coarse-grained level.

### DEBUG

    public static final Level DEBUG

  The `DEBUG` Level designates fine-grained informational events that are most useful to debug an application.

### TRACE

    public static final Level TRACE

  The `TRACE` Level designates finer-grained informational events than the `DEBUG` level.

### ALL

    public static final Level ALL

  The `ALL` has the lowest possible rank and is intended to turn on all logging.

Constructor Detail

### Level

    protected Level(int level,
                    String levelStr,
                    int syslogEquivalent)

  Instantiate a Level object.

  Parameters:
    `level` - The logging level.
    `levelStr` - The level name.
    `syslogEquivalent` - The matching syslog level.

Method Detail

### toLevel

    public static Level toLevel(String sArg)

  Convert the string passed as argument to a level. If the conversion fails, then this method returns `DEBUG`.

  Parameters:
    `sArg` - The level name.
  Returns:
    The Level.

### toLevel

    public static Level toLevel(int val)

  Convert an integer passed as argument to a level. If the conversion fails, then this method returns `DEBUG`.

  Parameters:
    `val` - The integer value of the Level.
  Returns:
    The Level.

### toLevel

    public static Level toLevel(int val,
                                Level defaultLevel)

  Convert an integer passed as argument to a level. If the conversion fails, then this method returns the specified default.

  Parameters:
    `val` - The integer value of the Level.
    `defaultLevel` - the default level if the integer doesn't match.
  Returns:
    The matching Level.

### toLevel

    public static Level toLevel(String sArg,
                                Level defaultLevel)

  Convert the string passed as argument to a level. If the conversion fails, then this method returns the value of `defaultLevel`.

  Parameters:
    `sArg` - The name of the Level.
    `defaultLevel` - The default Level to use.
  Returns:
    the matching Level.

### readResolve

    protected Object readResolve()
                          throws ObjectStreamException

  Resolved deserialized level to one of the stock instances. May be overridden in classes derived from Level.

  Returns:
    resolved object.
  Throws:
    `ObjectStreamException` - if exception during resolution.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1999-2015 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.