| |
|
| org.enhydra.logging.MonologFactory
MonologFactory | final public class MonologFactory extends LogFactory (Code) | | Concrete subclass of
LogFactory specific to log4j.
author: Costin Manolache |
Method Summary | |
public synchronized void | configure(String monologConfFile) Configure the logger. | public synchronized void | configure() Default configuration of the logger. | public Object | getAttribute(String name) Return the configuration attribute with the specified name (if any),
or null if there is no such attribute. | public String[] | getAttributeNames() Return an array containing the names of all currently defined
configuration attributes. | public Log | getInstance(Class clazz) Convenience method to derive a name from the specified class and
call getInstance(String) with it. | public Log | getInstance(String name) | public void | release() Release any internal references to previously created
Log instances returned by this factory. | public void | removeAttribute(String name) Remove any configuration attribute associated with the specified name. | public void | setAttribute(String name, Object value) Set the configuration attribute with the specified name. |
lf | public org.objectweb.util.monolog.api.LoggerFactory lf(Code) | | |
configure | public synchronized void configure(String monologConfFile)(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 synchronized void configure() throws ConfigException(Code) | | Default configuration of the logger. A JMX search for logger configuration file name.
This file must be present in the classpath
|
getAttribute | public Object getAttribute(String name)(Code) | | Return the configuration attribute with the specified name (if any),
or null if there is no such attribute.
Parameters: name - Name of the attribute to return |
getAttributeNames | public String[] getAttributeNames()(Code) | | Return an array containing the names of all currently defined
configuration attributes. If there are no such attributes, a zero
length array is returned.
|
getInstance | public Log getInstance(Class clazz) throws LogConfigurationException(Code) | | Convenience method to derive a name from the specified class and
call getInstance(String) with it.
Parameters: clazz - Class for which a suitable Log name will be derived exception: LogConfigurationException - if a suitable Log instance cannot be returned |
getInstance | public Log getInstance(String name) throws LogConfigurationException(Code) | | |
release | public void release()(Code) | | Release any internal references to previously created
Log instances returned by this factory. This is useful environments
like servlet containers, which implement application reloading by
throwing away a ClassLoader. Dangling references to objects in that
class loader would prevent garbage collection.
|
removeAttribute | public void removeAttribute(String name)(Code) | | Remove any configuration attribute associated with the specified name.
If there is no such attribute, no action is taken.
Parameters: name - Name of the attribute to remove |
setAttribute | public void setAttribute(String name, Object value)(Code) | | Set the configuration attribute with the specified name. Calling
this with a null value is equivalent to calling
removeAttribute(name) .
Parameters: name - Name of the attribute to set Parameters: value - Value of the attribute to set, or null to remove any setting for this attribute |
|
|
|