Examples of LumifyLogger


Examples of io.lumify.core.util.LumifyLogger

        return new File(configDirectory);
    }

    public Configuration load(File configDirectory) {
        LumifyLogger LOGGER = LumifyLoggerFactory.getLogger(FileConfigurationLoader.class);

        LOGGER.debug("Attempting to load configuration from directory: %s", configDirectory);
        if (!configDirectory.exists()) {
            throw new RuntimeException("Could not find config directory: " + configDirectory);
        }

        File[] files = configDirectory.listFiles();
View Full Code Here

Examples of io.lumify.core.util.LumifyLogger

        return new Configuration(this, properties);
    }

    private static Map<String, String> loadFile(final String fileName) throws IOException {
        LumifyLogger LOGGER = LumifyLoggerFactory.getLogger(FileConfigurationLoader.class);

        Map<String, String> results = new HashMap<String, String>();
        LOGGER.info("Loading config file: %s", fileName);
        FileInputStream in = new FileInputStream(fileName);
        try {
            Properties properties = new Properties();
            properties.load(in);
            for (Map.Entry<Object, Object> prop : properties.entrySet()) {
                String key = prop.getKey().toString();
                String value = prop.getValue().toString();
                results.put(key, value);
            }
        } catch (Exception e) {
            LOGGER.info("Could not load configuration file: %s", fileName);
        } finally {
            in.close();
        }
        return results;
    }
View Full Code Here

Examples of io.lumify.core.util.LumifyLogger

        File log4jFile = resolveFileName("log4j.xml");
        if (log4jFile == null || !log4jFile.exists()) {
            throw new RuntimeException("Could not find log4j configuration at \"" + log4jFile + "\". Did you forget to copy \"docs/log4j.xml.sample\" to \"" + log4jFile + "\"");
        }
        DOMConfigurator.configure(log4jFile.getAbsolutePath());
        LumifyLogger logger = LumifyLoggerFactory.getLogger(LumifyLoggerFactory.class);
        logger.info("Using ConfigurationLoader: %s", this.getClass().getName());
        logger.info("Using log4j.xml: %s", log4jFile);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.