Search in sources :

Example 1 with ConfigurationProperties

use of org.apache.geode.distributed.ConfigurationProperties in project geode by apache.

the class CacheServerLauncher method isLoggingToStdOut.

/**
   * Reads {@link DistributedSystem#PROPERTY_FILE} and determines if the
   * {@link ConfigurationProperties#LOG_FILE} property is set to stdout
   * 
   * @return true if the logging would go to stdout
   */
private static boolean isLoggingToStdOut() {
    Properties gfprops = new Properties();
    URL url = DistributedSystem.getPropertyFileURL();
    if (url != null) {
        try {
            gfprops.load(url.openStream());
        } catch (IOException io) {
            // throw new GemFireIOException("Failed reading " + url, io);
            System.out.println("Failed reading " + url);
            System.exit(1);
        }
        final String logFile = gfprops.getProperty(LOG_FILE);
        if (logFile == null || logFile.length() == 0) {
            return true;
        }
    } else {
        // Didnt find a property file, assuming the default is to log to stdout
        return true;
    }
    return false;
}
Also used : IOException(java.io.IOException) ConfigurationProperties(org.apache.geode.distributed.ConfigurationProperties) Properties(java.util.Properties) URL(java.net.URL)

Aggregations

IOException (java.io.IOException)1 URL (java.net.URL)1 Properties (java.util.Properties)1 ConfigurationProperties (org.apache.geode.distributed.ConfigurationProperties)1