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

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.DatagramTargetFactory
All Implemented Interfaces:
Configurable, Contextualizable, LogEnabled, LogTargetFactory

public class DatagramTargetFactory
extends AbstractTargetFactory

This factory creates LogTargets with a wrapped DatagramOutputTarget around it.

Configuration syntax:

 <datagram-target id="target-id">
   <address hostname="hostname" port="4455" />
     <format type="extended">
                %7.7{priority} %23.23{time:yyyy-MM-dd HH:mm:ss:SSS} [%25.25{category}] : %{message}\n%{throwable}
     </format>
 </datagram-target>
 

This factory creates a DatagramOutputTarget object which will sends datagrams to the specified address. The name of the target is specified by the hostname attribute of the <address> element and the port by the port attribute.The <address> element wraps the format to output the log.

Author:
Avalon Development Team

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

DatagramTargetFactory

public DatagramTargetFactory()
Method Detail

createTarget

public LogTarget createTarget(Configuration conf)
                       throws ConfigurationException
Create a LogTarget based on a Configuration

Throws:
ConfigurationException

getFormatter

protected Formatter getFormatter(Configuration conf)
Returns the Formatter

Parameters:
conf - Configuration for the formatter


Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.