Class PropertiesUtilPropertyEnvironment
java.lang.Object
org.apache.logging.log4j.kit.env.support.BasicPropertyEnvironment
org.apache.logging.log4j.kit.env.internal.PropertiesUtilPropertyEnvironment
- All Implemented Interfaces:
PropertyEnvironment
An adapter of the
PropertiesUtil from Log4j API 2.x.
Since PropertiesUtil requires all properties to start with log4j2., we must add the prefix
before querying for the property.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPropertiesUtilPropertyEnvironment(org.apache.logging.log4j.util.PropertiesUtil propsUtil, org.apache.logging.log4j.Logger statusLogger) -
Method Summary
Modifier and TypeMethodDescription@Nullable StringgetProperty(String name) Gets the named property as a String.Methods inherited from class org.apache.logging.log4j.kit.env.support.BasicPropertyEnvironment
getClassForName, getProperty, toBoolean, toCharArray, toCharset, toClass, toDuration, toEnum, toInteger, toLevel, toLocale, toLong, toPath, toTimeZone, toURI, toZoneId
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
PropertiesUtilPropertyEnvironment
public PropertiesUtilPropertyEnvironment(org.apache.logging.log4j.util.PropertiesUtil propsUtil, org.apache.logging.log4j.Logger statusLogger)
-
-
Method Details
-
getProperty
Description copied from interface:PropertyEnvironmentGets the named property as a String.- Specified by:
getPropertyin interfacePropertyEnvironment- Specified by:
getPropertyin classBasicPropertyEnvironment- Parameters:
name- the name of the property to look up- Returns:
- the String value of the property or
nullif undefined.
-