- All Implemented Interfaces:
Serializable
,Comparable<LogPriority>
,Constable
This enumeration defines the various log priorities to be used by the
application logger. Them log priorities are inspired by common loggers such a
slog4jand the Syslog priorities. Them priorities have the following meaning
as of "http://en.wikipedia.org/wiki/Syslog":
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescription"Should be corrected immediately, therefore notify staff who can fix the problem."Should be corrected immediately, but indicates failure in a secondary system, an example is a loss of a backup ISP connection.""Info useful to developers for debugging the application, not useful during operations."Log is deactivated."Non-urgent failures, these should be relayed to developers or admins; each item must be resolved within a given time.""Additional information which might be useful for some stability period."No priority (has been set yet)."Events that are unusual but not error conditions - might be summarized in an email to developers or admins to spot potential problems - no immediate action required.""A "panic" condition usually affecting multiple apps/servers/sites."Info useful to developers for debugging the application, not useful during operations.""Warning messages, not an error, but indication that an error will occur if action is not taken, e.g. file system 85% full - each item must be resolved within a given time." -
Method Summary
Modifier and TypeMethodDescriptionstatic LogPriority
Translates (as good as it gets) a JULLevel
to aLogPriority
.The Log-Level is the String representation of theLogPriority
, as required by theRuntimeLoggerImpl.setLogLevel(String)
.int
Returns the severity of the log priority.toLevel()
Translates (as good as it gets) aLogPriority
to a JULLevel
.static LogPriority
toProprtiry
(String aPriorityName) Determines the priority from the given name, ignoring the case.static LogPriority
Returns the enum constant of this class with the specified name.static LogPriority[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
PANIC
"A "panic" condition usually affecting multiple apps/servers/sites. At this level it would usually notify all tech staff on call." ( See also http://en.wikipedia.org/wiki/Syslog -
ALERT
"Should be corrected immediately, therefore notify staff who can fix the problem. An example would be the loss of a primary ISP connection." See also http://en.wikipedia.org/wiki/Syslog -
CRITICAL
"Should be corrected immediately, but indicates failure in a secondary system, an example is a loss of a backup ISP connection." See also http://en.wikipedia.org/wiki/Syslog -
ERROR
"Non-urgent failures, these should be relayed to developers or admins; each item must be resolved within a given time." See also http://en.wikipedia.org/wiki/Syslog -
WARN
"Warning messages, not an error, but indication that an error will occur if action is not taken, e.g. file system 85% full - each item must be resolved within a given time." See also http://en.wikipedia.org/wiki/Syslog -
NOTICE
"Events that are unusual but not error conditions - might be summarized in an email to developers or admins to spot potential problems - no immediate action required." See also http://en.wikipedia.org/wiki/Syslog -
INFO
"Additional information which might be useful for some stability period." See also http://en.wikipedia.org/wiki/Syslog -
DEBUG
"Info useful to developers for debugging the application, not useful during operations." See also http://en.wikipedia.org/wiki/Syslog -
TRACE
"Info useful to developers for debugging the application, not useful during operations." See also http://en.wikipedia.org/wiki/Syslog TRACE provides even more comments for the developer when debugging. -
DISCARD
Log is deactivated. -
NONE
No priority (has been set yet).
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getPriority
public int getPriority()Returns the severity of the log priority.- Returns:
- aSeverity The severity of a log priority, the smaller, the less severe, the higher, the more severe.
-
getLogLevel
The Log-Level is the String representation of theLogPriority
, as required by theRuntimeLoggerImpl.setLogLevel(String)
.- Returns:
- The String representation of the
LogPriority
.
-
toProprtiry
Determines the priority from the given name, ignoring the case.- Parameters:
aPriorityName
- The for which to retrieve the priority.- Returns:
- The according
LogPriority
or null if none was determinable.
-
fromLevel
Translates (as good as it gets) a JULLevel
to aLogPriority
.- Parameters:
aLevel
- The JULLevel
to be translated.- Returns:
- The according
LogPriority
.
-
toLevel
Translates (as good as it gets) aLogPriority
to a JULLevel
.- Returns:
- The according
Level
.
-