Class PriorityFilteringTarget

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

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
  • Field Details

    • m_priority

      private final Priority m_priority
    • m_closeWrapped

      private final boolean m_closeWrapped
    • m_targets

      private LogTarget[] m_targets
      Log targets in filter chain
  • Constructor Details

    • 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 Details

    • addTarget

      public void addTarget(LogTarget target)
      Add a new target to output chain.
      Parameters:
      target - the target
    • doProcessEvent

      protected void doProcessEvent(LogEvent event) throws 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:
      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