public final class Log4jFactory extends LogFactory
Concrete subclass of LogFactory
specific to log4j.
Modifier and Type | Field and Description |
---|---|
private java.util.Hashtable |
attributes
Deprecated.
The configuration attributes for this
LogFactory . |
private java.util.Hashtable |
instances
Deprecated.
|
DIAGNOSTICS_DEST_PROPERTY, factories, FACTORY_DEFAULT, FACTORY_PROPERTIES, FACTORY_PROPERTY, HASHTABLE_IMPLEMENTATION_PROPERTY, nullClassLoaderFactory, PRIORITY_KEY, SERVICE_ID, TCCL_KEY
Constructor and Description |
---|
Log4jFactory()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getAttribute(java.lang.String name)
Deprecated.
Return the configuration attribute with the specified name (if any),
or
null if there is no such attribute. |
java.lang.String[] |
getAttributeNames()
Deprecated.
Return an array containing the names of all currently defined
configuration attributes.
|
Log |
getInstance(java.lang.Class clazz)
Deprecated.
Convenience method to derive a name from the specified class and
call
getInstance(String) with it. |
Log |
getInstance(java.lang.String name)
Deprecated.
Construct (if necessary) and return a
Log instance,
using the factory's current set of configuration attributes. |
void |
release()
Deprecated.
Release any internal references to previously created
Log
instances returned by this factory. |
void |
removeAttribute(java.lang.String name)
Deprecated.
Remove any configuration attribute associated with the specified name.
|
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Deprecated.
Set the configuration attribute with the specified name.
|
createFactory, directGetContextClassLoader, getClassLoader, getContextClassLoader, getFactory, getLog, getLog, isDiagnosticsEnabled, logRawDiagnostic, logRawDiagnostic, newFactory, newFactory, objectId, release, releaseAll
private java.util.Hashtable attributes
LogFactory
.private java.util.Hashtable instances
public java.lang.Object getAttribute(java.lang.String name)
null
if there is no such attribute.getAttribute
in class LogFactory
name
- Name of the attribute to returnpublic java.lang.String[] getAttributeNames()
getAttributeNames
in class LogFactory
public Log getInstance(java.lang.Class clazz) throws LogConfigurationException
getInstance(String)
with it.getInstance
in class LogFactory
clazz
- Class for which a suitable Log name will be derivedLogConfigurationException
- if a suitable Log
instance cannot be returnedpublic Log getInstance(java.lang.String name) throws LogConfigurationException
LogFactory
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 class 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)LogConfigurationException
- if a suitable Log
instance cannot be returnedpublic void release()
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 class LogFactory
public void removeAttribute(java.lang.String name)
removeAttribute
in class LogFactory
name
- Name of the attribute to removepublic void setAttribute(java.lang.String name, java.lang.Object value)
null
value is equivalent to calling
removeAttribute(name)
.setAttribute
in class LogFactory
name
- Name of the attribute to setvalue
- Value of the attribute to set, or null
to remove any setting for this attributeCopyright 2001-2005 The Apache Software Foundation.