Package org.apache.logging.log4j.util
Class SystemPropertiesPropertySource
java.lang.Object
org.apache.logging.log4j.util.SystemPropertiesPropertySource
- All Implemented Interfaces:
PropertySource
PropertySource backed by the current system properties. Other than having a
higher priority over normal properties, this follows the same rules as
PropertiesPropertySource
.- Since:
- 2.10.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.logging.log4j.util.PropertySource
PropertySource.Comparator, PropertySource.Util
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
forEach
(BiConsumer<String, String> action) Iterates over all properties and performs an action for each key/value pair.getNormalForm
(Iterable<? extends CharSequence> tokens) Converts a list of property name tokens into a normal form.int
Returns the order in which this PropertySource has priority.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.logging.log4j.util.PropertySource
containsProperty, getProperty
-
Field Details
-
DEFAULT_PRIORITY
private static final int DEFAULT_PRIORITY- See Also:
-
PREFIX
- See Also:
-
-
Constructor Details
-
SystemPropertiesPropertySource
public SystemPropertiesPropertySource()
-
-
Method Details
-
getPriority
public int getPriority()Description copied from interface:PropertySource
Returns the order in which this PropertySource has priority. A higher value means that the source will be applied later so as to take precedence over other property sources.- Specified by:
getPriority
in interfacePropertySource
- Returns:
- priority value
-
forEach
Description copied from interface:PropertySource
Iterates over all properties and performs an action for each key/value pair.- Specified by:
forEach
in interfacePropertySource
- Parameters:
action
- action to perform on each key/value pair
-
getNormalForm
Description copied from interface:PropertySource
Converts a list of property name tokens into a normal form. For example, a list of tokens such as "foo", "bar", "baz", might be normalized into the property name "log4j2.fooBarBaz".- Specified by:
getNormalForm
in interfacePropertySource
- Parameters:
tokens
- list of property name tokens- Returns:
- a normalized property name using the given tokens
-