| org.jzonic.jlo.CommonsLogManager
CommonsLogManager | public class CommonsLogManager extends LogFactory implements FileListener(Code) | | This class manages all LogConfigurations. It is the point of entry for jLo.
There is only one instance of the LogManager to make sure that all classes
in one JVM will work with the same configurations.
In order to get a Logger you have to call:
private static final Logger logger = LogManager.getLogger("com.foo.app");
In this case the LogManager when instanciated will search for a file
called "jlo_logging.xml" in your classpath and process it.
This method is error save that means that it will always return a valid
Logger.
Since jLo supports many LogConfigurations you can also use this method:
private static final Logger logger = LogManager.getLogger("com.foo.app","foo");
If you provide a configuration name then the LogManager will search for a
file called "foo_logging.xml" in your classpath and process it.
author: Andreas Mecky author: Terry Dye version: 1.0 |
CommonsLogManager | public CommonsLogManager()(Code) | | |
fileChanged | public void fileChanged(FileListenerEvent e)(Code) | | This method, once implemented, will be called when the File object
itself changes.
Parameters: FileListenerEvent - The FileListener object. |
flush | public void flush()(Code) | | Call thi smethod if you want to force the LogProcessor to write
all pending log statements immediately
|
getInstance | public static CommonsLogManager getInstance()(Code) | | This method returns the one and only instance of the LogManager.
the instance of the LogManager |
getInstance | public Log getInstance(String str) throws org.apache.commons.logging.LogConfigurationException(Code) | | |
getInstance | public Log getInstance(Class clazz) throws org.apache.commons.logging.LogConfigurationException(Code) | | |
getLog | public static Log getLog(String loggerName)(Code) | | This method returns a Logger from the LogConfiguration.
The name of the LogConfiguration is default and the corresponding
file is jlo_logging.xml. This method uses the LogConfiguration.getLogger
method.
Parameters: loggerName - the name of the logger the Logger or the DefaultLogger if not found |
getLog | public static Log getLog(String loggerName, String configurationName)(Code) | | This methods returns a logger for the given name from the specific
logconfiguration. If a logger with the given name does not exist then
the LogConfiguration will try to search for it by going up the hierarchy.
If still no logger is found then this method will return the DefaultLogger.
This method will never return null therefore it is save to do this:
private static final Logger logger = LogManager.getLogger("org.foo.app");
in your class. If there is no instance of the LogManager so far then
a new one will be created.
Parameters: loggerName - the name of the logger Parameters: configurationName - the name of the configuration the requested logger or the next one in the hierarchy or the default |
release | public void release()(Code) | | |
removeAttribute | public void removeAttribute(String str)(Code) | | |
|
|