public void setConfiguration(Configuration cfg) throws ConfigurationException { try { String log_priority = cfg.get("priority"); if ((log_priority != null) && (!log_priority.trim().equals(""))) { if (levels.containsKey(log_priority)) priority = log_priority; } } catch (Exception e) { throw new ConfigurationException(e); } }
/** * Expects the following properties: * * <ul> * <li>config - Configuration file path * <li>priority - Log4J priority (debug, info, warn, error) * <li>watch - interval (in ms) to monitor XML config file for changes * </ul> */ public void setConfiguration(Configuration cfg) throws ConfigurationException { DOMConfigurator.configureAndWatch(cfg.get("config"), cfg.getLong("watch")); setLevel(cfg.get("priority")); }