Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-19

Provide looser coupling of PatternConverters

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0-alpha1
    • Layouts
    • None

    Description

      Currently, PatternLayout calls PatternParser which knows about the various PatternConverters, many of which are imbedded in it. This makes it difficult for users to add their own Converters.
      In the logging framework I created each converter identified the conversion characters it supported. Each PatternConverter was required to supply a getKeys() method that returned this list. The equivalent of the PatternLayout contained an array of PatternConverters. During initialization each of these would be called and the list of keys recorded along with the associated converter. To add your own converter all that was necessary was to extend the class and add your new keys to the list of recorded keys along with their converters. The base PatternLayout would then take care of calling the correct converters as necessary.

      Attachments

        Activity

          People

            rgoers Ralph Goers
            rgoers Ralph Goers
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: