org.apache.log.output
Class PriorityFilteringTarget

java.lang.Object
  extended byorg.apache.log.output.AbstractTarget
      extended byorg.apache.log.output.PriorityFilteringTarget
All Implemented Interfaces:
Closeable, ErrorAware, LogTarget

public class PriorityFilteringTarget
extends AbstractTarget

This is a priority filtering target that forwards only requests to other (wrapped) targets that have the same or a higher priority.

Author:
Avalon Development Team

Constructor Summary
PriorityFilteringTarget(Priority priority)
           
PriorityFilteringTarget(Priority priority, boolean closeWrappedTarget)
           
 
Method Summary
 void addTarget(LogTarget target)
          Add a new target to output chain.
 void close()
          Shutdown target.
protected  void doProcessEvent(LogEvent event)
          Process a log event, via formatting and outputting it.
 
Methods inherited from class org.apache.log.output.AbstractTarget
getErrorHandler, isOpen, open, processEvent, setErrorHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PriorityFilteringTarget

public PriorityFilteringTarget(Priority priority,
                               boolean closeWrappedTarget)
Parameters:
priority - The priority used to filter
closeWrappedTarget - see AbstractWrappingTarget

PriorityFilteringTarget

public PriorityFilteringTarget(Priority priority)
Parameters:
priority - The priority used to filter
Method Detail

addTarget

public void addTarget(LogTarget target)
Add a new target to output chain.

Parameters:
target - the target

doProcessEvent

protected void doProcessEvent(LogEvent event)
                       throws java.lang.Exception
Description copied from class: AbstractTarget
Process a log event, via formatting and outputting it. This should be overidden by subclasses.

Specified by:
doProcessEvent in class AbstractTarget
Parameters:
event - the log event
Throws:
java.lang.Exception - if an event processing error occurs

close

public void close()
Description copied from class: AbstractTarget
Shutdown target. Attempting to write to target after close() will cause errors to be logged.

Specified by:
close in interface Closeable
Overrides:
close in class AbstractTarget


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