| |
|
| java.lang.Object org.apache.commons.logging.LogFactory org.apache.commons.logging.impl.SLF4JLogFactory
SLF4JLogFactory | public class SLF4JLogFactory extends LogFactory (Code) | |
Concrete subclass of
LogFactory which always delegates to the
LoggerFactory org.slf4j.LoggerFactory class.
This factory generates instances of
SLF4JLog . It will remember
previously created instances for the same name, and will return them on
repeated requests to the getInstance() method.
This implementation ignores any configured attributes.
author: Rod Waldhoff author: Craig R. McClanahan author: Richard A. Sitze author: Ceki Gülcü |
Constructor Summary | |
public | SLF4JLogFactory() Public no-arguments constructor required by the lookup mechanism. |
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)
Construct (if necessary) and return a Log instance, using
the factory's current set of configuration attributes. | public void | release() Release any internal references to previously created
org.apache.commons.logging.Log instances returned by this factory.
This is useful in environments like servlet containers, which implement
application reloading by throwing away a ClassLoader. | 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. |
LOG_PROPERTY | final public static String LOG_PROPERTY(Code) | | The name of the system property identifying our
Log implementation
class.
|
SLF4JLogFactory | public SLF4JLogFactory()(Code) | | Public no-arguments constructor required by the lookup mechanism.
|
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) | |
Construct (if necessary) and return a Log instance, using
the factory's current set of configuration attributes.
Parameters: name - Logical name of the Log instance to be returned(the meaning of this name is only known to the underlying loggingimplementation that is being wrapped) exception: LogConfigurationException - if a suitable Log instance cannot be returned |
release | public void release()(Code) | | Release any internal references to previously created
org.apache.commons.logging.Log instances returned by this factory.
This is useful in 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 removeany setting for this attribute |
|
|
|