org.apache.log4j

Class Level

public class Level extends Priority implements Serializable

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

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

Author: Ceki Gülcü

Field Summary
static LevelALL
The ALL has the lowest possible rank and is intended to turn on all logging.
static LevelDEBUG
The DEBUG Level designates fine-grained informational events that are most useful to debug an application.
static LevelERROR
The ERROR level designates error events that might still allow the application to continue running.
static LevelFATAL
The FATAL level designates very severe error events that will presumably lead the application to abort.
static LevelINFO
The INFO level designates informational messages that highlight the progress of the application at coarse-grained level.
static LevelOFF
The OFF has the highest possible rank and is intended to turn off logging.
static LevelTRACE
The TRACE Level designates finer-grained informational events than the DEBUG
static intTRACE_INT
TRACE level integer value.
static LevelWARN
The WARN level designates potentially harmful situations.
Constructor Summary
protected Level(int level, String levelStr, int syslogEquivalent)
Instantiate a Level object.
Method Summary
static LeveltoLevel(String sArg)
Convert the string passed as argument to a level.
static LeveltoLevel(int val)
Convert an integer passed as argument to a level.
static LeveltoLevel(int val, Level defaultLevel)
Convert an integer passed as argument to a level.
static LeveltoLevel(String sArg, Level defaultLevel)
Convert the string passed as argument to a level.

Field Detail

ALL

public static final Level ALL
The ALL has the lowest possible rank and is intended to turn on all logging.

DEBUG

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

ERROR

public static final Level ERROR
The ERROR level designates error events that might still allow the application to continue running.

FATAL

public static final Level FATAL
The FATAL level designates very severe error events that will presumably lead the application to abort.

INFO

public static final Level INFO
The INFO level designates informational messages that highlight the progress of the application at coarse-grained level.

OFF

public static final Level OFF
The OFF has the highest possible rank and is intended to turn off logging.

TRACE

public static final Level TRACE
The TRACE Level designates finer-grained informational events than the DEBUGSince: 1.2.12

TRACE_INT

public static final int TRACE_INT
TRACE level integer value.

Since: 1.2.12

WARN

public static final Level WARN
The WARN level designates potentially harmful situations.

Constructor Detail

Level

protected Level(int level, String levelStr, int syslogEquivalent)
Instantiate a Level object.

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.

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.

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.

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.
Copyright 2000-2005 Apache Software Foundation.