org.apache.commons.logging.impl
public class SLF4JLogFactory extends LogFactory
Concrete subclass of LogFactory which always delegates to the
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.
Field Summary | |
---|---|
protected Hashtable | attributes
Configuration attributes. |
static String | LOG_PROPERTY
The name of the system property identifying our Logimplementation
class. |
Constructor Summary | |
---|---|
SLF4JLogFactory()
Public no-arguments constructor required by the lookup mechanism. |
Method Summary | |
---|---|
Object | getAttribute(String name)
Return the configuration attribute with the specified name (if any), or
null if there is no such attribute.
|
String[] | getAttributeNames()
Return an array containing the names of all currently defined configuration
attributes. |
Log | getInstance(Class clazz)
Convenience method to derive a name from the specified class and call
getInstance(String) with it.
|
Log | getInstance(String name)
Construct (if necessary) and return a |
void | release()
Release any internal references to previously created
Loginstances returned by this factory.
|
void | removeAttribute(String name)
Remove any configuration attribute associated with the specified name. |
void | setAttribute(String name, Object value)
Set the configuration attribute with the specified name. |
null
if there is no such attribute.
Parameters: name Name of the attribute to return
getInstance(String)
with it.
Parameters: clazz Class for which a suitable Log name will be derived
Throws: LogConfigurationException
if a suitable Log
instance cannot be returned
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 logging
implementation that is being wrapped)
Throws: LogConfigurationException
if a suitable Log
instance cannot be returned
Parameters: name Name of the attribute to remove
null
value is equivalent to calling
removeAttribute(name)
.
Parameters: name
Name of the attribute to set value
Value of the attribute to set, or null
to remove
any setting for this attribute