Package org.apache.log4j
Class Level
java.lang.Object
org.apache.log4j.Priority
org.apache.log4j.Level
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
UtilLoggingLevel
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LevelTheALLhas the lowest possible rank and is intended to turn on all logging.static final LevelTheDEBUGLevel designates fine-grained informational events that are most useful to debug an application.static final LevelTheERRORlevel designates error events that might still allow the application to continue running.static final LevelTheFATALlevel designates very severe error events that will presumably lead the application to abort.static final LevelTheINFOlevel designates informational messages that highlight the progress of the application at coarse-grained level.static final LevelTheOFFhas the highest possible rank and is intended to turn off logging.private static final longSerialization version id.static final LevelTheTRACELevel designates finer-grained informational events than theDEBUGlevel.static final intTRACE level integer value.static final LevelTheWARNlevel designates potentially harmful situations. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidCustom deserialization of Level.protected ObjectResolved deserialized level to one of the stock instances.static LeveltoLevel(int val) Convert an integer passed as argument to a level.static LevelConvert an integer passed as argument to a level.static LevelConvert the string passed as argument to a level.static LevelConvert the string passed as argument to a level.private voidSerialize level.Methods inherited from class org.apache.log4j.Priority
equals, getAllPossiblePriorities, getSyslogEquivalent, hashCode, isGreaterOrEqual, toInt, toPriority, toPriority, toPriority, toPriority, toString
-
Field Details
-
TRACE_INT
public static final int TRACE_INTTRACE level integer value.- Since:
- 1.2.12
- See Also:
-
OFF
TheOFFhas the highest possible rank and is intended to turn off logging. -
FATAL
TheFATALlevel designates very severe error events that will presumably lead the application to abort. -
ERROR
TheERRORlevel designates error events that might still allow the application to continue running. -
WARN
TheWARNlevel designates potentially harmful situations. -
INFO
TheINFOlevel designates informational messages that highlight the progress of the application at coarse-grained level. -
DEBUG
TheDEBUGLevel designates fine-grained informational events that are most useful to debug an application. -
TRACE
TheTRACELevel designates finer-grained informational events than theDEBUGlevel. -
ALL
TheALLhas the lowest possible rank and is intended to turn on all logging. -
serialVersionUID
private static final long serialVersionUIDSerialization version id.- See Also:
-
-
Constructor Details
-
Level
Instantiate a Level object.- Parameters:
level- The logging level.levelStr- The level name.syslogEquivalent- The matching syslog level.
-
-
Method Details
-
toLevel
Convert the string passed as argument to a level. If the conversion fails, then this method returnsDEBUG.- Parameters:
sArg- The level name.- Returns:
- The Level.
-
toLevel
Convert an integer passed as argument to a level. If the conversion fails, then this method returnsDEBUG.- Parameters:
val- The integer value of the Level.- Returns:
- The Level.
-
toLevel
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
Convert the string passed as argument to a level. If the conversion fails, then this method returns the value ofdefaultLevel.- Parameters:
sArg- The name of the Level.defaultLevel- The default Level to use.- Returns:
- the matching Level.
-
readObject
Custom deserialization of Level.- Parameters:
s- serialization stream.- Throws:
IOException- if IO exception.ClassNotFoundException- if class not found.
-
writeObject
Serialize level.- Parameters:
s- serialization stream.- Throws:
IOException- if exception during serialization.
-
readResolve
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.
-