| |
|
| java.lang.Object com.lutris.logging.Logger com.lutris.logging.Log4jLogger
Log4jLogger | public class Log4jLogger extends com.lutris.logging.Logger (Code) | | 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.
author: Vladimir Puskas author: Predrag Djoic author: Sinisa Milosevic See Also: com.lutris.logging.Logger See Also: com.lutris.logging.LogChannel |
Constructor Summary | |
public | Log4jLogger(boolean makeCentral) Construct a new logger. |
Method Summary | |
public synchronized void | configure(String log4jConfFile) Configure the logger. | public void | configure(Config logConfig) | public LogChannel | getChannel(String facility) Get the log channel object for a facility. | public synchronized int | getLevel(String level) Convert a symbolic level to an integer identifier,
creating it if it doesn't exist
Parameters: level - Symbolic level that is to be checked. | public String | getLevelName(int level) Convert an int to a symbolic level name.
Parameters: level - an int level. |
DEFAULT_LOG_CONFIG_FILE | protected String DEFAULT_LOG_CONFIG_FILE(Code) | | Default Log4j configuration file
|
activeLogFile | File activeLogFile(Code) | | Log file name.
|
enabledLevelFlags | protected boolean[] enabledLevelFlags(Code) | | Table of levels that are to be enabled.
Accessed directly by the channel. If null, ignored.
|
levelNames | protected String[] levelNames(Code) | | Table translating level number to name and the largest entry in the
array that is valid. Will be expanded if needed.
|
logFileLevelFlags | protected boolean[] logFileLevelFlags(Code) | | Table of levels that are to be written to the log file.
Accessed directly by the channel. If null, ignored.
|
logFileStream | PrintWriter logFileStream(Code) | | Log file writter. Use directly by channels.
|
numLevels | protected int numLevels(Code) | | |
stderrLevelFlags | protected boolean[] stderrLevelFlags(Code) | | Table of levels that are to be written to stderr
Accessed directly by the channel. If null, then
the default behavior of writing serious standard
levels to stderr is in affect.
|
stderrStream | PrintWriter stderrStream(Code) | | Stderr writter. Use directly by channels.
|
Log4jLogger | public Log4jLogger(boolean makeCentral)(Code) | | Construct a new logger. Configuration is not done now, to allow
the logger to be created very early.
Parameters: makeCentral - Make this object the central logging object. |
configure | public synchronized void configure(String log4jConfFile) throws ConfigException(Code) | | Configure the logger. All current configuration is discarded.
This is a simplistic initial implementation that just allows
directing to a single log file or stderr on a level basis.
A more complete interface will be provided in the future.
Parameters: logFile - The log file to write to. Parameters: fileLevels - List of levels that will be written to the file. Parameters: stderrLevels - List of levels that will be written to stderr.The same level may appear in both lists. exception: java.io.IOException - If an error occurs opening the log file. |
configure | public void configure(Config logConfig) throws ConfigException(Code) | | Configure Logger with given config section
Parameters: logConfig - containing parameters for configuring logger |
getChannel | public LogChannel getChannel(String facility)(Code) | | Get the log channel object for a facility. For a given facility,
the same object is always returned.
Parameters: facility - Facility the channel is associated with. |
getLevel | public synchronized int getLevel(String level)(Code) | | Convert a symbolic level to an integer identifier,
creating it if it doesn't exist
Parameters: level - Symbolic level that is to be checked. The numeric level identifier |
getLevelName | public String getLevelName(int level)(Code) | | Convert an int to a symbolic level name.
Parameters: level - an int level. The String symolic level name or null if there is not one. |
|
|
|