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:
- Configurable, Contextualizable, LogEnabled, LogTargetFactory
- public class StreamTargetFactory
- extends AbstractTargetFactory
- implements 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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StreamTargetFactory
public StreamTargetFactory()
createTarget
public LogTarget createTarget(Configuration configuration)
throws ConfigurationException
- Create a LogTarget based on a Configuration
- Specified by:
createTarget
in interface LogTargetFactory
- Throws:
ConfigurationException
contextualize
public void contextualize(Context context)
throws ContextException
- Description copied from interface:
Contextualizable
- Pass the Context to the component.
This method is called after the LogEnabled.enableLogging( Logger ) (if present)
method and before any other method.
- Specified by:
contextualize
in interface Contextualizable
- Overrides:
contextualize
in class AbstractTargetFactory
- Throws:
ContextException
getFormatter
protected Formatter getFormatter(Configuration conf)
Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.