Log4j 2
  1. Log4j 2
  2. LOG4J2-54

Support existing ability to modify any of an event's fields

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0-alpha1
    • Component/s: None
    • Labels:
      None

      Description

      RewriteAppender and RewritePolicy in log4j 1.2 give appender writers the ability to change events before they are sent to appenders. Two examples: adding properties to all events using PropertyRewritePolicy, and X-ing out passwords and sensitive text, logger names truncating stack traces because of sensitive class information.

        Activity

        Hide
        Ralph Goers added a comment -

        Closing since there have been no other comments since this was marked resolved.

        Show
        Ralph Goers added a comment - Closing since there have been no other comments since this was marked resolved.
        Hide
        Ralph Goers added a comment -

        Log4j 2 implements RewriteAppender and RewritePolicy.

        Show
        Ralph Goers added a comment - Log4j 2 implements RewriteAppender and RewritePolicy.
        Hide
        Ralph Goers added a comment -

        I added the RewriteAppender and RewritePolicy to the experimental Log4j 2.0. I also added a MapRewritePolicy that can modify a MapMessage.

        Show
        Ralph Goers added a comment - I added the RewriteAppender and RewritePolicy to the experimental Log4j 2.0. I also added a MapRewritePolicy that can modify a MapMessage.
        Hide
        Ralph Goers added a comment -

        For all intents and purposes, yes it is immutable. An Appender that wraps other Appenders can create a new LogEvent from the one passed to it and give the new LogEvent to the Appenders it wraps. The RewritePolicy interface takes a LogEvent as a parameter and returns one as the result.

        Show
        Ralph Goers added a comment - For all intents and purposes, yes it is immutable. An Appender that wraps other Appenders can create a new LogEvent from the one passed to it and give the new LogEvent to the Appenders it wraps. The RewritePolicy interface takes a LogEvent as a parameter and returns one as the result.
        Hide
        scott deboy added a comment -

        Are logging events immutable? Curious how you will add support for the RewriteAppender & policies if that's the case.

        Show
        scott deboy added a comment - Are logging events immutable? Curious how you will add support for the RewriteAppender & policies if that's the case.
        Hide
        Ralph Goers added a comment -

        I see that RewriteAppender was recently added to 1.2. I'll be happy to add the same functionality to 2.0.

        Show
        Ralph Goers added a comment - I see that RewriteAppender was recently added to 1.2. I'll be happy to add the same functionality to 2.0.

          People

          • Assignee:
            Ralph Goers
            Reporter:
            scott deboy
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development