Log4j 2
  1. Log4j 2
  2. LOG4J2-157

Provide access to config properties in LoggerConfig

    Details

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

      Description

      Custom Loggers that want to support configuration properties when creating custom LogEvent objects currently have no easy way to access these configuration Property objects.

      The configuration Property map in LoggerConfig is private. Please provide an accessor method that returns a (read-only) view of this Property map.

      proposal: add below method to org.apache.logging.log4j.core.config.LoggerConfig:

      /**

      • Returns an unmodifiable map with the configuration properties, or
      • {@code null} if this {@code LoggerConfig} does not have any configuration
        * properties.
        * <p>
        * For each {@code Property} key in the map, the value is {@code true} if
        * the property value has a variable that needs to be substituted.
        *
        * @return an unmodifiable map with the configuration properties, or
        * {@code null}
      • @see Configuration#getSubst()
      • @see StrSubstitutor
        */
        public Map<Property, Boolean> getProperties() { return properties == null ? null : Collections.unmodifiableMap(properties); }

        Issue Links

          Activity

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          63d 15h 36m 1 Ralph Goers 01/Apr/13 04:52
          Resolved Resolved Closed Closed
          2h 1 Remko Popma 01/Apr/13 06:52
          Gavin made changes -
          Link This issue is depended upon by LOG4J2-163 [ LOG4J2-163 ]
          Gavin made changes -
          Link This issue blocks LOG4J2-163 [ LOG4J2-163 ]
          Remko Popma made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Hide
          Remko Popma added a comment -

          Verified as complete.

          Show
          Remko Popma added a comment - Verified as complete.
          Ralph Goers made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Ralph Goers [ ralph.goers@dslextreme.com ]
          Fix Version/s 2.0-beta5 [ 12323970 ]
          Resolution Fixed [ 1 ]
          Hide
          Ralph Goers added a comment -

          Patch applied in revision 1463078. Please verify and close.

          Show
          Ralph Goers added a comment - Patch applied in revision 1463078. Please verify and close.
          Remko Popma made changes -
          Link This issue blocks LOG4J2-163 [ LOG4J2-163 ]
          Remko Popma made changes -
          Attachment LOG4J2-157-patch.txt [ 12566763 ]
          Hide
          Remko Popma added a comment -

          attached patch is based on trunk

          Show
          Remko Popma added a comment - attached patch is based on trunk
          Remko Popma made changes -
          Field Original Value New Value
          Link This issue is depended upon by LOG4J2-151 [ LOG4J2-151 ]
          Remko Popma created issue -

            People

            • Assignee:
              Ralph Goers
              Reporter:
              Remko Popma
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development