org.apache.commons.logging.impl
Class Log4jFactory
public final class Log4jFactory
Concrete subclass of
LogFactory
specific to log4j.
Log4jFactory() - Protected constructor that is not available for public use.
|
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
Log instance,
using the factory's current set of configuration attributes.
|
void | release() - Release any internal references to previously created
Log
instances 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.
|
cacheFactory , getAttribute , getAttributeNames , getCachedFactory , getContextClassLoader , getFactory , getInstance , getInstance , getLog , getLog , getResourceAsStream , newFactory , release , release , releaseAll , removeAttribute , setAttribute |
attributes
private Hashtable attributes
instances
private Hashtable instances
Log4jFactory
public Log4jFactory()
Protected constructor that is not available for public use.
getAttribute
public Object getAttribute(String name)
Return the configuration attribute with the specified name (if any),
or null
if there is no such attribute.
- getAttribute in interface LogFactory
name
- Name of the attribute to return
getAttributeNames
public String[] getAttributeNames()
Return an array containing the names of all currently defined
configuration attributes. If there are no such attributes, a zero
length array is returned.
- getAttributeNames in interface LogFactory
getInstance
public Log getInstance(Class clazz)
throws LogConfigurationException
Convenience method to derive a name from the specified class and
call getInstance(String)
with it.
- getInstance in interface LogFactory
clazz
- Class for which a suitable Log name will be derived
getInstance
public Log getInstance(String name)
throws LogConfigurationException
Construct (if necessary) and return a
Log
instance,
using the factory's current set of configuration attributes.
NOTE - Depending upon the implementation of
the
LogFactory
you are using, the
Log
instance you are returned may or may not be local to the current
application, and may or may not be returned again on a subsequent
call with the same name argument.
- getInstance in interface LogFactory
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)
release
public void release()
Release any internal references to previously created
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.
- release in interface LogFactory
removeAttribute
public void removeAttribute(String name)
Remove any configuration attribute associated with the specified name.
If there is no such attribute, no action is taken.
- removeAttribute in interface LogFactory
name
- Name of the attribute to remove
setAttribute
public void setAttribute(String name,
Object value)
Set the configuration attribute with the specified name. Calling
this with a null
value is equivalent to calling
removeAttribute(name)
.
- setAttribute in interface LogFactory
name
- Name of the attribute to setvalue
- Value of the attribute to set, or null
to remove any setting for this attribute
Copyright 2002-2004 The Apache Software Foundation.