|
EAF 7.4 Implementation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lutris.logging.Logger
com.lutris.logging.Log4jLogger
public class Log4jLogger
Log4j implementation of the Logger
. This is
general-purpose logging facility. A client that needs additional
functionality can either extend this class or provide there own
implementationm of Logger
.
Currently this is a bare-bones class that writes INFO and above levels to stderr and all others to a log file.
Logger
,
LogChannel
Field Summary | |
---|---|
protected java.lang.String |
DEFAULT_LOG_CONFIG_FILE
Default Log4j configuration file |
protected boolean[] |
enabledLevelFlags
Table of levels that are to be enabled. |
protected java.lang.String[] |
levelNames
Table translating level number to name and the largest entry in the array that is valid. |
protected boolean[] |
logFileLevelFlags
Table of levels that are to be written to the log file. |
protected int |
numLevels
|
protected boolean[] |
stderrLevelFlags
Table of levels that are to be written to stderr Accessed directly by the channel. |
Fields inherited from class com.lutris.logging.Logger |
---|
ALERT, centralLogger, CRITICAL, DEBUG, DEBUG1, DEBUG2, DEBUG3, DEBUG4, DEBUG5, DEBUG6, DEBUG7, DEBUG8, DEBUG9, DEBUGTMP, EMERGENCY, ERROR, INFO, MAX_STD_LEVEL, NOTICE, standardLevelNames, WARNING |
Constructor Summary | |
---|---|
Log4jLogger(boolean makeCentral)
Construct a new logger. |
Method Summary | |
---|---|
void |
configure(com.lutris.util.Config logConfig)
Configure Logger with given config section |
void |
configure(java.lang.String log4jConfFile)
Configure the logger. |
com.lutris.logging.LogChannel |
getChannel(java.lang.String facility)
Get the log channel object for a facility. |
int |
getLevel(java.lang.String level)
Convert a symbolic level to an integer identifier, creating it if it doesn't exist |
java.lang.String |
getLevelName(int level)
Convert an int to a symbolic level name. |
Methods inherited from class com.lutris.logging.Logger |
---|
getCentralLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String[] levelNames
protected int numLevels
protected boolean[] enabledLevelFlags
protected boolean[] logFileLevelFlags
protected boolean[] stderrLevelFlags
protected java.lang.String DEFAULT_LOG_CONFIG_FILE
Constructor Detail |
---|
public Log4jLogger(boolean makeCentral)
makeCentral
- Make this object the central logging object.Method Detail |
---|
public void configure(java.lang.String log4jConfFile) throws com.lutris.util.ConfigException
configure
in class com.lutris.logging.Logger
logFile
- The log file to write to.fileLevels
- List of levels that will be written to the file.stderrLevels
- List of levels that will be written to stderr.
The same level may appear in both lists.
java.io.IOException
- If an error occurs opening the log file.
com.lutris.util.ConfigException
public com.lutris.logging.LogChannel getChannel(java.lang.String facility)
getChannel
in class com.lutris.logging.Logger
facility
- Facility the channel is associated with.public int getLevel(java.lang.String level)
level
- Symbolic level that is to be checked.
public java.lang.String getLevelName(int level)
level
- an int level.
public void configure(com.lutris.util.Config logConfig) throws com.lutris.util.ConfigException
configure
in class com.lutris.logging.Logger
logConfig
- containing parameters for configuring logger
com.lutris.util.ConfigException
|
EAF 7.4 Implementation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |