Class AppenderAttachableImpl

java.lang.Object
org.apache.log4j.helpers.AppenderAttachableImpl
All Implemented Interfaces:
AppenderAttachable

public class AppenderAttachableImpl extends Object implements AppenderAttachable
Allows Classes to attach Appenders.
  • Field Details

  • Constructor Details

    • AppenderAttachableImpl

      public AppenderAttachableImpl()
  • Method Details

    • addAppender

      public void addAppender(Appender newAppender)
      Description copied from interface: AppenderAttachable
      Add an appender.
      Specified by:
      addAppender in interface AppenderAttachable
      Parameters:
      newAppender - The Appender to add.
    • appendLoopOnAppenders

      public int appendLoopOnAppenders(LoggingEvent event)
      Calls the doAppend method on all attached appenders.
      Parameters:
      event - The event to log.
      Returns:
      The number of appenders.
    • close

      public void close()
      Closes all appenders.
    • getAllAppenders

      public Enumeration<Appender> getAllAppenders()
      Description copied from interface: AppenderAttachable
      Get all previously added appenders as an Enumeration.
      Specified by:
      getAllAppenders in interface AppenderAttachable
      Returns:
      The Enumeration of the Appenders.
    • getAppender

      public Appender getAppender(String name)
      Description copied from interface: AppenderAttachable
      Get an appender by name.
      Specified by:
      getAppender in interface AppenderAttachable
      Parameters:
      name - The name of the Appender.
      Returns:
      The Appender.
    • isAttached

      public boolean isAttached(Appender appender)
      Description copied from interface: AppenderAttachable
      Returns true if the specified appender is in list of attached attached, false otherwise.
      Specified by:
      isAttached in interface AppenderAttachable
      Parameters:
      appender - The Appender to check.
      Returns:
      true if the Appender is attached.
    • removeAllAppenders

      public void removeAllAppenders()
      Description copied from interface: AppenderAttachable
      Remove all previously added appenders.
      Specified by:
      removeAllAppenders in interface AppenderAttachable
    • removeAppender

      public void removeAppender(Appender appender)
      Description copied from interface: AppenderAttachable
      Remove the appender passed as parameter from the list of appenders.
      Specified by:
      removeAppender in interface AppenderAttachable
      Parameters:
      appender - The Appender to remove.
    • removeAppender

      public void removeAppender(String name)
      Description copied from interface: AppenderAttachable
      Remove the appender with the name passed as parameter from the list of appenders.
      Specified by:
      removeAppender in interface AppenderAttachable
      Parameters:
      name - The name of the Appender to remove.