if (level == null) { level = Level.OFF; } String temp = "OFF"; if (level == Level.ALL) { temp = "ALL"; } else if (level == Level.INFO) { temp = "INFO"; } else if (level == Level.DEBUG) { temp = "DEBUG"; } else if (level == Level.WARN) { temp = "WARN"; } else if (level == Level.FATAL) { temp = "FATAL"; } setAttributeByTagName(new String[] {"options", "logging", "level"} , temp); Logger rootLogger = Logger.getRootLogger(); rootLogger.setLevel(level); rootLogger.removeAllAppenders(); if (level != Level.OFF) { try { FileAppender fileAppender = new FileAppender(AppleJuiceClient. getLoggerHtmlLayout(), AppleJuiceClient.getLoggerFileAppenderPath()); rootLogger.addAppender(fileAppender); } catch (IOException ioe) { rootLogger.addAppender(new ConsoleAppender()); ioe.printStackTrace(); } } else { rootLogger.addAppender(new ConsoleAppender()); } if (logger.isEnabledFor(Level.DEBUG)) { logger.debug("Loglevel geaendert in " + level.toString()); } }
if (level == null) { level = Level.OFF; } String temp = "OFF"; if (level == Level.ALL) { temp = "ALL"; } else if (level == Level.INFO) { temp = "INFO"; } else if (level == Level.DEBUG) { temp = "DEBUG"; } else if (level == Level.WARN) { temp = "WARN"; } else if (level == Level.FATAL) { temp = "FATAL"; } propertyHandler.put("options_logging_level", temp); Logger rootLogger = Logger.getRootLogger(); rootLogger.setLevel(level); rootLogger.removeAllAppenders(); if (level != Level.OFF) { try { FileAppender fileAppender = new FileAppender(AppleJuiceClient .getLoggerHtmlLayout(), AppleJuiceClient .getLoggerFileAppenderPath()); rootLogger.addAppender(fileAppender); } catch (IOException ioe) { rootLogger.addAppender(new ConsoleAppender()); ioe.printStackTrace(); } } else { rootLogger.addAppender(new ConsoleAppender()); } if (logger.isEnabledFor(Level.DEBUG)) { logger.debug("Loglevel geaendert in " + level.toString()); } }
    public void setLogLevel(Level level) {        if (level == null) {            level = Level.OFF;        }        String temp = "OFF";        if (level == Level.ALL) {            temp = "ALL";        }        else if (level == Level.INFO) {            temp = "INFO";        }        else if (level == Level.DEBUG) {            temp = "DEBUG";        }        else if (level == Level.WARN) {            temp = "WARN";        }        else if (level == Level.FATAL) {            temp = "FATAL";        }        setAttributeByTagName(new String[] {"options", "logging", "level"}                              , temp);        Logger rootLogger = Logger.getRootLogger();        rootLogger.setLevel(level);        rootLogger.removeAllAppenders();        if (level != Level.OFF) {            try {                FileAppender fileAppender = new FileAppender(AppleJuiceClient.                    getLoggerHtmlLayout(),                    AppleJuiceClient.getLoggerFileAppenderPath());                rootLogger.addAppender(fileAppender);            }            catch (IOException ioe) {                rootLogger.addAppender(new ConsoleAppender());                ioe.printStackTrace();            }        }        else {            rootLogger.addAppender(new ConsoleAppender());        }        if (logger.isEnabledFor(Level.DEBUG)) {            logger.debug("Loglevel geaendert in " + level.toString());        }    }