コード例 #1
0
        public static void configureLogger(ConfigurationManager cm)
        {
            if (java.lang.System.getProperty("java.util.logging.config.class") != null ||
                java.lang.System.getProperty("java.util.logging.config.file") != null)
            {
                return;
            }
            string logPrefix = ConfigurationManagerUtils.getLogPrefix(cm);
            Logger logger    = Logger.getLogger(String.instancehelper_substring(logPrefix, 0, String.instancehelper_length(logPrefix) - 1));
            Level  level     = Logger.getLogger("").getLevel();

            ConfigurationManagerUtils.configureLogger(logger);
            string text = cm.getGlobalProperty("logLevel");

            if (text == null)
            {
                text = Level.WARNING.getName();
            }
            logger.setLevel(Level.parse(text));
            Logger.getLogger("").setLevel(level);
        }
コード例 #2
0
        public ConfigurationManager(URL url)
        {
            this.changeListeners  = new ArrayList();
            this.symbolTable      = new LinkedHashMap();
            this.rawPropertyMap   = new HashMap();
            this.globalProperties = new HashMap();
            this.configURL        = url;
            try
            {
                this.rawPropertyMap = new SaxLoader(url, this.globalProperties).load();
            }
            catch (IOException ex)
            {
                throw new RuntimeException(ex);
            }
            ConfigurationManagerUtils.applySystemProperties(this.rawPropertyMap, this.globalProperties);
            ConfigurationManagerUtils.configureLogger(this);
            string text = (string)this.globalProperties.get("showCreations");

            if (text != null)
            {
                this.showCreations = String.instancehelper_equals("true", text);
            }
        }