Log4j 2
  1. Log4j 2
  2. LOG4J2-420

Create a lookup for resource bundle substitution

    Details

    • Type: Question Question
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta9
    • Fix Version/s: 2.0-rc1
    • Component/s: API
    • Labels:
      None
    • Environment:

      Windows 7

      Description

      I'm attempting to do property substitution using a lookup. At initialization or runtime, I want emails in a resource bundle to replace a place placeholder value in the log4j2.xml file. For more information about the question I posted this question on stack overflow: http://stackoverflow.com/questions/19277445/how-to-use-map-lookups-using-log4j2

      1. log4j2xml.png
        19 kB
        Jonathan Willis
      2. bundlemap.png
        27 kB
        Jonathan Willis
      3. image001.png
        14 kB
        Jonathan Willis

        Activity

        Hide
        Gary Gregory added a comment -

        I added a new lookup for the next release (whether it is a beta or release candidate):

        Committed revision 1531064.

        You can use it now if you build Log4J from source. The format is documented if you build the site, it is used as follows:

        ${bundle:BundleName:BundleKey}
        

        For example:

        ${bundle:com.domain.Messages:MyKey}
        

        The java.util.ResourceBundle class will look for com/domain/Messages.properties on the classpath.

        Show
        Gary Gregory added a comment - I added a new lookup for the next release (whether it is a beta or release candidate): Committed revision 1531064. You can use it now if you build Log4J from source. The format is documented if you build the site, it is used as follows: ${bundle:BundleName:BundleKey} For example: ${bundle:com.domain.Messages:MyKey} The java.util.ResourceBundle class will look for com/domain/Messages.properties on the classpath.
        Hide
        Jonathan Willis added a comment - - edited

        I would like to be able to get my current implementation working, though. I'll try this fix first, however.

        Show
        Jonathan Willis added a comment - - edited I would like to be able to get my current implementation working, though. I'll try this fix first, however.
        Hide
        Jonathan Willis added a comment -

        How do I download Log4j from source?

        Show
        Jonathan Willis added a comment - How do I download Log4j from source?
        Hide
        Woonsan Ko added a comment -

        You can checkout source from the trunk through svn and build it (2.0RC1-SNAPSHOT at the moment) locally with maven:

        Show
        Woonsan Ko added a comment - You can checkout source from the trunk through svn and build it (2.0RC1-SNAPSHOT at the moment) locally with maven: http://logging.apache.org/log4j/2.x/source-repository.html http://logging.apache.org/log4j/2.x/build.html
        Hide
        Jonathan Willis added a comment -

        [cid:image001.png@01CEC5D8.D450B570]

        Show
        Jonathan Willis added a comment - [cid:image001.png@01CEC5D8.D450B570]

          People

          • Assignee:
            Unassigned
            Reporter:
            Jonathan Willis
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development