GUACAMOLE-641: Log primary sources of configuration information.

This commit is contained in:
Michael Jumper
2020-08-25 17:25:27 -07:00
parent c54f126824
commit 4dd2a80c84
6 changed files with 85 additions and 11 deletions

View File

@@ -130,8 +130,9 @@ public class GuacamoleServletContextListener extends GuiceServletContextListener
// Read configuration information from GUACAMOLE_HOME/guacamole.properties
try {
environment.addGuacamoleProperties(new FileGuacamoleProperties(
new File(environment.getGuacamoleHome(), "guacamole.properties")));
File guacProperties = new File(environment.getGuacamoleHome(), "guacamole.properties");
environment.addGuacamoleProperties(new FileGuacamoleProperties(guacProperties));
logger.info("Read configuration parameters from \"{}\".", guacProperties);
}
catch (GuacamoleException e) {
logger.error("Unable to read guacamole.properties: {}", e.getMessage());
@@ -142,8 +143,11 @@ public class GuacamoleServletContextListener extends GuiceServletContextListener
// read from system environment if "enable-environment-properties" is
// set to "true"
try {
if (environment.getProperty(ENABLE_ENVIRONMENT_PROPERTIES, false))
if (environment.getProperty(ENABLE_ENVIRONMENT_PROPERTIES, false)) {
environment.addGuacamoleProperties(new SystemEnvironmentGuacamoleProperties());
logger.info("Additional configuration parameters may be read "
+ "from environment variables.");
}
}
catch (GuacamoleException e) {
logger.error("Unable to configure support for environment properties: {}", e.getMessage());