org.apache.avalon.excalibur.logger.factory
Class StreamTargetFactory

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.avalon.excalibur.logger.factory.AbstractTargetFactory
          extended byorg.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

    Field Summary
     
    Fields inherited from class org.apache.avalon.excalibur.logger.factory.AbstractTargetFactory
    m_configuration, m_context
     
    Constructor Summary
    StreamTargetFactory()
               
     
    Method Summary
     void contextualize(Context context)
              Pass the Context to the component.
     LogTarget createTarget(Configuration configuration)
              Create a LogTarget based on a Configuration
    protected  Formatter getFormatter(Configuration conf)
               
     
    Methods inherited from class org.apache.avalon.excalibur.logger.factory.AbstractTargetFactory
    configure
     
    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
     

    Constructor Detail

    StreamTargetFactory

    public StreamTargetFactory()
    Method Detail

    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.