Defines the minimum set of levels recognized by the system, that is
| Field Summary |
|---|
| public static final int | TRACE_INT | TRACE level integer value. |
| public static final Level | OFF | The OFF has the highest possible rank and is
intended to turn off logging. |
| public static final Level | FATAL | The FATAL level designates very severe error
events that will presumably lead the application to abort. |
| public static final Level | ERROR | The ERROR level designates error events that
might still allow the application to continue running. |
| public static final Level | WARN | The WARN level designates potentially harmful situations. |
| public static final Level | INFO | The INFO level designates informational messages
that highlight the progress of the application at coarse-grained
level. |
| public static final Level | DEBUG | The DEBUG Level designates fine-grained
informational events that are most useful to debug an
application. |
| public static final Level | TRACE | The TRACE Level designates finer-grained
informational events than the DEBUGsince: 1.2.12 - |
| public static final Level | ALL | The ALL has the lowest possible rank and is intended to
turn on all logging. |
| static final long | serialVersionUID | Serialization version id. |
| Fields inherited from org.apache.log4j.Priority: |
|---|
| level, levelStr, syslogEquivalent, OFF_INT, FATAL_INT, ERROR_INT, WARN_INT, INFO_INT, DEBUG_INT, ALL_INT, FATAL, ERROR, WARN, INFO, DEBUG |
| Method from org.apache.log4j.Level Detail: |
public static Level toLevel(String sArg) {
return (Level) toLevel(sArg, Level.DEBUG);
}
Convert the string passed as argument to a level. If the
conversion fails, then this method returns #DEBUG . |
public static Level toLevel(int val) {
return (Level) toLevel(val, Level.DEBUG);
}
Convert an integer passed as argument to a level. If the
conversion fails, then this method returns #DEBUG . |
public static Level toLevel(int val,
Level defaultLevel) {
switch(val) {
case ALL_INT: return ALL;
case DEBUG_INT: return Level.DEBUG;
case INFO_INT: return Level.INFO;
case WARN_INT: return Level.WARN;
case ERROR_INT: return Level.ERROR;
case FATAL_INT: return Level.FATAL;
case OFF_INT: return OFF;
case TRACE_INT: return Level.TRACE;
default: return defaultLevel;
}
}
Convert an integer passed as argument to a level. If the
conversion fails, then this method returns the specified default. |
public static Level toLevel(String sArg,
Level defaultLevel) {
if(sArg == null)
return defaultLevel;
String s = sArg.toUpperCase();
if(s.equals("ALL")) return Level.ALL;
if(s.equals("DEBUG")) return Level.DEBUG;
if(s.equals("INFO")) return Level.INFO;
if(s.equals("WARN")) return Level.WARN;
if(s.equals("ERROR")) return Level.ERROR;
if(s.equals("FATAL")) return Level.FATAL;
if(s.equals("OFF")) return Level.OFF;
if(s.equals("TRACE")) return Level.TRACE;
//
// For Turkish i problem, see bug 40937
//
if(s.equals("\u0130NFO")) return Level.INFO;
return defaultLevel;
}
Convert the string passed as argument to a level. If the
conversion fails, then this method returns the value of
defaultLevel. |