Log4j 2
  1. Log4j 2
  2. LOG4J2-36

Appender interface should be refactored

    Details

    • Type: Wish Wish
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Appenders
    • Labels:
      None

      Description

      The Appender interface in log4j 1.2 (carried over in the rgoers contribution) requires an implementation to not only define its distinctive logging destination also but also a composite filter (the addFilter(), getFilter(), getFilters() method). Because of that almost all custom appenders in log4j 1.2 extend from AppenderSkeleton to inherit the implementation of composite filter. The appender interface should be refactored so it contains a reference to a generic Filter (which may or may not be a composite filter) and a Channel (or whatever we want to call the bit that makes one appender different from another).

        Activity

        Hide
        Ralph Goers added a comment -

        Closing this since there doesn't seem to be any more discussion about it.

        Show
        Ralph Goers added a comment - Closing this since there doesn't seem to be any more discussion about it.
        Hide
        Ralph Goers added a comment - - edited

        Log4j 2 was modified so that wherever filtering is allowed only a single Filter is used. However, the Filter may be a composite filter that contains other filters. Also, while not required, most Appenders use a Manager that takes on most of the work the appender does.

        Show
        Ralph Goers added a comment - - edited Log4j 2 was modified so that wherever filtering is allowed only a single Filter is used. However, the Filter may be a composite filter that contains other filters. Also, while not required, most Appenders use a Manager that takes on most of the work the appender does.
        Hide
        Ralph Goers added a comment -

        The Appender interface is the experimental Log4j 2.0 does not contain any reference to Filters. AppenderBase does extend Filterable so that any appenders extending it will have filtering support. Filterable manages a single Filter which may be a CompositeFilter that contains several filters. Layout is part of the Appender. I'm not clear on the significance of changing the name Appender to Channel. I'm also not clear what the refactoring suggested above really buys.

        Show
        Ralph Goers added a comment - The Appender interface is the experimental Log4j 2.0 does not contain any reference to Filters. AppenderBase does extend Filterable so that any appenders extending it will have filtering support. Filterable manages a single Filter which may be a CompositeFilter that contains several filters. Layout is part of the Appender. I'm not clear on the significance of changing the name Appender to Channel. I'm also not clear what the refactoring suggested above really buys.
        Hide
        Curt Arnold added a comment -

        Layout should be part of the Channel since some appenders (such as SocketAppender) do not contain a Layout.

        Show
        Curt Arnold added a comment - Layout should be part of the Channel since some appenders (such as SocketAppender) do not contain a Layout.

          People

          • Assignee:
            Unassigned
            Reporter:
            Curt Arnold
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development