Class StatusLogger.PropertiesUtilsDouble

java.lang.Object
org.apache.logging.log4j.status.StatusLogger.PropertiesUtilsDouble
Enclosing class:
StatusLogger

static final class StatusLogger.PropertiesUtilsDouble extends Object
This is a thin double of PropertiesUtil.

We could have used PropertiesUtil, PropertyFilePropertySource, etc. Consequently, they would delegate to LoaderUtil, etc. All these mechanisms expect a working StatusLogger. In order to be self-sufficient, we cannot rely on them, hence this double.

  • Constructor Details

    • PropertiesUtilsDouble

      PropertiesUtilsDouble()
  • Method Details

    • readProperty

      static @Nullable String readProperty(Map<String,Object> normalizedProperties, String propertyName)
    • readAllAvailableProperties

      static Map<String,Object> readAllAvailableProperties()
    • readEnvironmentProperties

      private static Properties readEnvironmentProperties()
    • readPropertiesFile

      static Properties readPropertiesFile(String propertiesFileName)
    • normalizeProperties

      private static Map<String,Object> normalizeProperties(Properties... propertiesList)
    • isRelevantPropertyName

      private static boolean isRelevantPropertyName(@Nullable Object propertyName)
      Filter to exclude irrelevant property names (i.e., non-string and not log4j-prefixed) to speed up matching.
      Parameters:
      propertyName - a property name
      Returns:
      true, if the property name is relevant; false, otherwise
    • normalizePropertyName

      private static String normalizePropertyName(String propertyName)
      An imperfect property name normalization routine.

      It is imperfect, because foo.bar would match with fo.obar. But it is good enough for the StatusLogger needs.

      Parameters:
      propertyName - the input property name
      Returns:
      the normalized property name