org.apache.avalon.logging.logkit.factory.datagram
Class DatagramTargetFactory

java.lang.Object
  extended byorg.apache.avalon.logging.logkit.factory.datagram.DatagramTargetFactory
All Implemented Interfaces:
LogTargetFactory

public class DatagramTargetFactory
extends Object
implements LogTargetFactory

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 <format> element wraps the format to output the log.

Version:
$Revision: 1.5 $ $Date: 2004/03/17 10:30:09 $
Author:
Avalon Development Team

Constructor Summary
DatagramTargetFactory(FormatterFactory formatter)
           
 
Method Summary
 LogTarget createTarget(Configuration conf)
          Create a LogTarget based on a supplied configuration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatagramTargetFactory

public DatagramTargetFactory(FormatterFactory formatter)
Method Detail

createTarget

public LogTarget createTarget(Configuration conf)
                       throws LogTargetException
Create a LogTarget based on a supplied configuration

Specified by:
createTarget in interface LogTargetFactory
Parameters:
conf - the target coonfiguration
Returns:
the datagram target
Throws:
LogTargetException - if a target creation error occurs


Copyright © The Apache Software Foundation. All Rights Reserved.