public class LogFactoryImpl extends LogFactory
Concrete subclass of LogFactory that implements the following algorithm to dynamically select a logging implementation class to instantiate a wrapper for.
org.apache.commons.logging.Log to identify the requested implementation class.org.apache.commons.logging.Log system property to identify the requested implementation class.org.apache.commons.logging.impl.Log4JLogger.org.apache.commons.logging.impl.Jdk14Logger.org.apache.commons.logging.impl.SimpleLog. If the selected Log implementation class has a setLogFactory() method that accepts a LogFactory parameter, this method will be called on each newly created * instance to identify the associated factory. This makes factory configuration attributes available to the Log instance, if it so desires.
This factory will remember previously created Log instances for the same name, and will return them on repeated requests to the getInstance() method.
| Modifier and Type | Field and Description |
|---|---|
static String |
ALLOW_FLAWED_CONTEXT_PROPERTY |
static String |
ALLOW_FLAWED_DISCOVERY_PROPERTY |
static String |
ALLOW_FLAWED_HIERARCHY_PROPERTY |
protected Hashtable |
attributes |
protected Hashtable |
instances |
static String |
LOG_PROPERTY |
protected static String |
LOG_PROPERTY_OLD |
protected Constructor |
logConstructor |
protected Class[] |
logConstructorSignature |
protected Method |
logMethod |
protected Class[] |
logMethodSignature |
DIAGNOSTICS_DEST_PROPERTY, factories, FACTORY_DEFAULT, FACTORY_PROPERTIES, FACTORY_PROPERTY, HASHTABLE_IMPLEMENTATION_PROPERTY, nullClassLoaderFactory, PRIORITY_KEY, SERVICE_ID, TCCL_KEY| Constructor and Description |
|---|
LogFactoryImpl() |
| Modifier and Type | Method and Description |
|---|---|
Object |
getAttribute(String name) |
String[] |
getAttributeNames() |
protected static ClassLoader |
getClassLoader(Class clazz) |
protected static ClassLoader |
getContextClassLoader() |
Log |
getInstance(Class clazz) |
Log |
getInstance(String name) |
protected String |
getLogClassName()
Deprecated.
|
protected Constructor |
getLogConstructor()
Deprecated.
|
protected static boolean |
isDiagnosticsEnabled() |
protected boolean |
isJdk13LumberjackAvailable()
Deprecated.
|
protected boolean |
isJdk14Available()
Deprecated.
|
protected boolean |
isLog4JAvailable()
Deprecated.
|
protected void |
logDiagnostic(String msg) |
protected Log |
newInstance(String name) |
void |
release() |
void |
removeAttribute(String name) |
void |
setAttribute(String name,
Object value) |
createFactory, directGetContextClassLoader, getFactory, getLog, getLog, logRawDiagnostic, newFactory, newFactory, objectId, release, releaseAllpublic static final String LOG_PROPERTY
protected static final String LOG_PROPERTY_OLD
public static final String ALLOW_FLAWED_CONTEXT_PROPERTY
public static final String ALLOW_FLAWED_DISCOVERY_PROPERTY
public static final String ALLOW_FLAWED_HIERARCHY_PROPERTY
protected Hashtable attributes
protected Hashtable instances
protected Constructor logConstructor
protected Class[] logConstructorSignature
protected Method logMethod
protected Class[] logMethodSignature
public Object getAttribute(String name)
getAttribute in class LogFactorypublic String[] getAttributeNames()
getAttributeNames in class LogFactorypublic Log getInstance(Class clazz) throws LogConfigurationException
getInstance in class LogFactoryLogConfigurationExceptionpublic Log getInstance(String name) throws LogConfigurationException
getInstance in class LogFactoryLogConfigurationExceptionpublic void release()
release in class LogFactorypublic void removeAttribute(String name)
removeAttribute in class LogFactorypublic void setAttribute(String name, Object value)
setAttribute in class LogFactoryprotected static ClassLoader getContextClassLoader() throws LogConfigurationException
LogConfigurationExceptionprotected static boolean isDiagnosticsEnabled()
protected static ClassLoader getClassLoader(Class clazz)
protected void logDiagnostic(String msg)
@Deprecated protected String getLogClassName()
@Deprecated protected Constructor getLogConstructor() throws LogConfigurationException
LogConfigurationException@Deprecated protected boolean isJdk13LumberjackAvailable()
@Deprecated protected boolean isJdk14Available()
@Deprecated protected boolean isLog4JAvailable()
protected Log newInstance(String name) throws LogConfigurationException
LogConfigurationExceptionCopyright © 2014. All rights reserved.