public class Log4JConfAdapter extends Log4JAdapter implements org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable
Note that in case of logging errors Log4J will (via the org.apache.log4j.helpers.LogLog class) write to System.err. This can be switched off but we can not substitute our own handler to log erros the way we prefer to do this. :-(
So, unlike the LogKit case we have no Log4JLogger helper to implement and hence a different architecture: this class is not a helper but a regular subclass of Log4JAdapter.
Attach PrefixDecorator and/or CachingDecorator if desired.
| Modifier and Type | Field and Description |
|---|---|
private org.apache.avalon.framework.context.Context |
m_context |
m_hierarchyROLE| Constructor and Description |
|---|
Log4JConfAdapter()
This constructor creates a completely independent
Log4J hierarchy.
|
| Modifier and Type | Method and Description |
|---|---|
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration)
Feed our configuration to Log4J.
|
void |
contextualize(org.apache.avalon.framework.context.Context context) |
getDefaultLogger, getLoggerForCategorypublic Log4JConfAdapter()
public void contextualize(org.apache.avalon.framework.context.Context context)
throws org.apache.avalon.framework.context.ContextException
contextualize in interface org.apache.avalon.framework.context.Contextualizableorg.apache.avalon.framework.context.ContextExceptionpublic void configure(org.apache.avalon.framework.configuration.Configuration configuration)
throws org.apache.avalon.framework.configuration.ConfigurationException
configure in interface org.apache.avalon.framework.configuration.Configurableorg.apache.avalon.framework.configuration.ConfigurationException