Class EnvConfig

java.lang.Object
me.nickhanson.codeforge.config.EnvConfig

public final class EnvConfig extends Object
Utility class for fetching environment-specific configuration properties. The environment is determined by the "APP_ENV" environment variable, defaulting to "dev" if not set.
Author:
Nick Hanson
  • Method Details

    • get

      public static String get(org.apache.logging.log4j.Logger logger, Properties props, String baseKey)
      Get the environment-specific property value.
      Parameters:
      props - the Properties object
      baseKey - the base key (without environment suffix)
      Returns:
      the property value for the current environment
      Throws:
      IllegalStateException - if the property is missing