private InputStream getLogbackConfiguration() {

        // Check for custom logback.xml
        File logbackFile = new File(environment.getGuacamoleHome(), "logback.xml");
        if (logbackFile.exists()) {
            try {
                logger.info("Loading logback configuration from \"{}\".", logbackFile);
                return new FileInputStream(logbackFile);
            }
            catch (FileNotFoundException e) {
                logger.info("Logback configuration could not be read "
                        + "from \"{}\": {}", logbackFile, e.getMessage());
            }
        }

        // Default to generating an internal logback.xml based on a simple
        // "log-level" property
        LogLevel level;
        try {
            level = environment.getProperty(LOG_LEVEL, LogLevel.INFO);
            logger.info("Logging will be at the \"{}\" level.", level.getCanonicalName());
        }
        catch (GuacamoleException e) {
            level = LogLevel.INFO;
            logger.error("Falling back to \"{}\" log level: {}", level.getCanonicalName(), e.getMessage());
        }

        return level.getLogbackConfiguration();

    }
Returns an InputStream that streams the contents of the "logback.xml"
file that Logback should read to configure logging to Guacamole. If the
user provided their own "logback.xml" within GUACAMOLE_HOME, this will
be an InputStream that reads the contents of that file. The required
"logback.xml" will otherwise be dynamically generated based on the value
of the "log-level" property.

@return
    An InputStream that streams the contents of the "logback.xml" file
    that Logback should read to configure logging to Guacamole.
guacamole/src/main/java/org/apache/guacamole/log/LogModule.java