org.apache.avalon.excalibur.logger.factory
Class StreamTargetFactory
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.avalon.excalibur.logger.factory.AbstractTargetFactory
org.apache.avalon.excalibur.logger.factory.StreamTargetFactory
- All Implemented Interfaces:
- LogTargetFactory, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.logger.LogEnabled
public class StreamTargetFactory
- extends AbstractTargetFactory
- implements org.apache.avalon.framework.context.Contextualizable
TargetFactory for StreamTarget
.
This factory is able to create different StreamTargets according to the following
configuration syntax:
<stream id="foo">
<stream>stream-context-name</stream>
<format type="raw|pattern|extended">pattern to be used if needed</format>
</stream>
The "stream-context-name" is the name of an java.io.OutputStream
that
is fetched in the context. This context contains two predefined streams :
"System.out
" for the system output stream,
"System.err
" for the system error stream.
The syntax of "format" is the same as in FileTargetFactory
.
- Version:
- CVS $Revision: 1.10 $ $Date: 2004/03/10 13:54:50 $
- Author:
- Avalon Development Team
Method Summary |
void |
contextualize(org.apache.avalon.framework.context.Context context)
Get the Context object |
org.apache.log.LogTarget |
createTarget(org.apache.avalon.framework.configuration.Configuration configuration)
Create a LogTarget based on a Configuration |
protected org.apache.log.format.Formatter |
getFormatter(org.apache.avalon.framework.configuration.Configuration conf)
|
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StreamTargetFactory
public StreamTargetFactory()
createTarget
public org.apache.log.LogTarget createTarget(org.apache.avalon.framework.configuration.Configuration configuration)
throws org.apache.avalon.framework.configuration.ConfigurationException
- Create a LogTarget based on a Configuration
- Specified by:
createTarget
in interface LogTargetFactory
- Throws:
org.apache.avalon.framework.configuration.ConfigurationException
contextualize
public void contextualize(org.apache.avalon.framework.context.Context context)
throws org.apache.avalon.framework.context.ContextException
- Description copied from class:
AbstractTargetFactory
- Get the Context object
- Specified by:
contextualize
in interface org.apache.avalon.framework.context.Contextualizable
- Overrides:
contextualize
in class AbstractTargetFactory
- Throws:
org.apache.avalon.framework.context.ContextException
getFormatter
protected org.apache.log.format.Formatter getFormatter(org.apache.avalon.framework.configuration.Configuration conf)
Copyright © 1997-2008 Apache Software Foundation. All Rights Reserved.