Package org.apache.commons.logging.impl
Class Log4jApiLogFactory
java.lang.Object
org.apache.commons.logging.LogFactory
org.apache.commons.logging.impl.Log4jApiLogFactory
Logger factory hardcoded to send everything to Log4j API.
 
Based on the `log4j-jcl` artifact from Apache Logging Services.
- Since:
- 1.3.0
- 
Field SummaryFields inherited from class org.apache.commons.logging.LogFactoryDIAGNOSTICS_DEST_PROPERTY, factories, FACTORY_DEFAULT, FACTORY_PROPERTIES, FACTORY_PROPERTY, HASHTABLE_IMPLEMENTATION_PROPERTY, nullClassLoaderFactory, PRIORITY_KEY, SERVICE_ID, TCCL_KEY
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiongetAttribute(String name) Gets the configuration attribute with the specified name (if any), ornullif there is no such attribute.String[]Gets an array containing the names of all currently defined configuration attributes.getInstance(Class<?> clazz) Gets a Log for the given class.getInstance(String name) Gets a (possibly new)Loginstance, using the factory's current set of configuration attributes.voidrelease()This method is supposed to clear all loggers.voidremoveAttribute(String name) Removes any configuration attribute associated with the specified name.voidsetAttribute(String name, Object value) Sets the configuration attribute with the specified name.Methods inherited from class org.apache.commons.logging.LogFactorycreateFactory, directGetContextClassLoader, getClassLoader, getContextClassLoader, getFactory, getLog, getLog, handleThrowable, isDiagnosticsEnabled, logRawDiagnostic, newFactory, newFactory, objectId, release, releaseAll
- 
Constructor Details- 
Log4jApiLogFactorypublic Log4jApiLogFactory()Constructs a new instance.
 
- 
- 
Method Details- 
getAttributeDescription copied from class:LogFactoryGets the configuration attribute with the specified name (if any), ornullif there is no such attribute.- Specified by:
- getAttributein class- LogFactory
- Parameters:
- name- Name of the attribute to return
- Returns:
- the configuration attribute with the specified name.
 
- 
getAttributeNamesDescription copied from class:LogFactoryGets an array containing the names of all currently defined configuration attributes. If there are no such attributes, a zero length array is returned.- Specified by:
- getAttributeNamesin class- LogFactory
- Returns:
- an array containing the names of all currently defined configuration attributes
 
- 
getInstanceDescription copied from class:LogFactoryGets a Log for the given class.- Specified by:
- getInstancein class- LogFactory
- Parameters:
- clazz- Class for which a suitable Log name will be derived
- Returns:
- a name from the specified class.
 
- 
getInstanceDescription copied from class:LogFactoryGets a (possibly new)Loginstance, using the factory's current set of configuration attributes.NOTE - Depending upon the implementation of the LogFactoryyou are using, theLoginstance 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.- Specified by:
- getInstancein class- LogFactory
- Parameters:
- name- Logical name of the- Loginstance to be returned (the meaning of this name is only known to the underlying logging implementation that is being wrapped)
- Returns:
- a Loginstance.
 
- 
releaseThis method is supposed to clear all loggers. In this implementation it will clear all the logger wrappers but the loggers managed by the underlying logger context will not be.- Specified by:
- releasein class- LogFactory
 
- 
removeAttributeDescription copied from class:LogFactoryRemoves any configuration attribute associated with the specified name. If there is no such attribute, no action is taken.- Specified by:
- removeAttributein class- LogFactory
- Parameters:
- name- Name of the attribute to remove
 
- 
setAttributeDescription copied from class:LogFactorySets the configuration attribute with the specified name. Calling this with anullvalue is equivalent to callingremoveAttribute(name).- Specified by:
- setAttributein class- LogFactory
- Parameters:
- name- Name of the attribute to set
- value- Value of the attribute to set, or- nullto remove any setting for this attribute
 
 
-