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 String
getProperty
(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:PropertyEnvironment
Gets the named property as a String.- Specified by:
getProperty
in interfacePropertyEnvironment
- Specified by:
getProperty
in classBasicPropertyEnvironment
- Parameters:
name
- the name of the property to look up- Returns:
- the String value of the property or
null
if undefined.
-