Any chance you could help me understand the rationale for this feature? I opted 
not to implement a method akin to MapLookup.getMap because that wasn't used, 
avoiding unnecessary API constraints allows us to refactor more easily in the 
future. If the values are required elsewhere, it may be reasonable, but I have 
another change in flight that may impact such consumers.

Thanks!
-ck

On Sat, Jan 15, 2022, at 18:45, ggreg...@apache.org wrote:
> This is an automated email from the ASF dual-hosted git repository.
> 
> ggregory pushed a commit to branch release-2.x
> in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
> 
> commit d402f360fbad18bc3c0902a65e8e53a1202e57d5
> Author: Gary Gregory <garydgreg...@gmail.com>
> AuthorDate: Sat Jan 15 18:45:37 2022 -0500
> 
>     Add PropertiesLookup#getProperties().
>     
>     Commit 1/2 for cherry-picking to master.
> ---
> .../logging/log4j/core/lookup/PropertiesLookup.java   | 19 ++++++++++++++++---
> 1 file changed, 16 insertions(+), 3 deletions(-)
> 
> diff --git 
> a/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/PropertiesLookup.java
>  
> b/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/PropertiesLookup.java
> index 995a71b..3066792 100644
> --- 
> a/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/PropertiesLookup.java
> +++ 
> b/log4j-core/src/main/java/org/apache/logging/log4j/core/lookup/PropertiesLookup.java
> @@ -34,16 +34,28 @@ public final class PropertiesLookup implements StrLookup {
>       */
>      private final Map<String, String> properties;
>  
> +    /**
> +     * Constructs a new instance for the given map.
> +     *
> +     * @param properties map these.
> +     */
>      public PropertiesLookup(final Map<String, String> properties) {
>          this.properties = properties == null
>                  ? Collections.emptyMap()
>                  : properties;
>      }
>  
> +    /**
> +     * Gets the property map.
> +     *
> +     * @return the property map.
> +     */
> +    public Map<String, String> getProperties() {
> +        return properties;
> +    }
> +
>      @Override
> -    public String lookup(
> -            @SuppressWarnings("ignored") final LogEvent event,
> -            final String key) {
> +    public String lookup(@SuppressWarnings("ignored") final LogEvent event, 
> final String key) {
>          return lookup(key);
>      }
>  
> @@ -65,4 +77,5 @@ public final class PropertiesLookup implements StrLookup {
>      public String toString() {
>          return "PropertiesLookup{properties=" + properties + '}';
>      }
> +
> }
> 

Reply via email to