Package org.apache.logging.log4j.util
Class PropertiesUtil.Environment
- java.lang.Object
-
- org.apache.logging.log4j.util.PropertiesUtil.Environment
-
- Enclosing class:
- PropertiesUtil
private static class PropertiesUtil.Environment extends java.lang.Object
Provides support for looking up global configuration properties via environment variables, property files, and system properties, in three variations:Normalized: all log4j-related prefixes removed, remaining property is camelCased with a log4j2 prefix for property files and system properties, or follows a LOG4J_FOO_BAR format for environment variables.
Legacy: the original property name as defined in the source pre-2.10.0.
Tokenized: loose matching based on word boundaries.
- Since:
- 2.10.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.lang.String>
literal
Maps a key to its value or the value of its normalization in the lowest priority source that contains it.private java.util.Set<PropertySource>
sources
private java.util.Map<java.util.List<java.lang.CharSequence>,java.lang.String>
tokenized
-
Constructor Summary
Constructors Modifier Constructor Description private
Environment(PropertySource propertySource)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPropertySource(PropertySource propertySource)
Allow a PropertySource to be added.private boolean
containsKey(java.lang.String key)
private java.lang.String
get(java.lang.String key)
private void
reload()
-
-
-
Field Detail
-
sources
private final java.util.Set<PropertySource> sources
-
literal
private final java.util.Map<java.lang.String,java.lang.String> literal
Maps a key to its value or the value of its normalization in the lowest priority source that contains it.
-
tokenized
private final java.util.Map<java.util.List<java.lang.CharSequence>,java.lang.String> tokenized
-
-
Constructor Detail
-
Environment
private Environment(PropertySource propertySource)
-
-
Method Detail
-
addPropertySource
public void addPropertySource(PropertySource propertySource)
Allow a PropertySource to be added.- Parameters:
propertySource
- The PropertySource to add.
-
reload
private void reload()
-
get
private java.lang.String get(java.lang.String key)
-
containsKey
private boolean containsKey(java.lang.String key)
-
-