| de.danet.an.util.log4j.ApplLog4jFactory
ApplLog4jFactory | public class ApplLog4jFactory extends LogFactory (Code) | | This class provides an alternate access to the log4j logging
library for Apache commons logging.. The necessity arises from the
usage of log4j as logging package in the JBoss application
server. As log4j is already included in JBoss' classpath and
configured by JBoss, we cannot have really independent application
level logging.
The central problem is the static default hierarchy used by
org.apache.log4j.Category . For a distinct application
level logging we need an alternate hierarchy. This factory uses
such an alternate hierarchy.
This implementation is based on the Log4JFactory from
Apache.
author: Michael Lipp version: $Revision: 1.3 $ |
Method Summary | |
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. |
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 |
|
|