Code example for Logger

Methods: setLevel

0
        final String levelString = getProperty(loggerName + ".level");
        if (levelString != null) {
            try { 
                AccessController.doPrivileged(new PrivilegedAction() {
                    public Object run() {
                        logger.setLevel(Level.parse(levelString.trim()));
                        return null; 
                    } 
                }); 
            } catch (IllegalArgumentException e) {
                // Leave level set to null 
            } 
        } 
 
        // If any parent loggers have levels definied, make sure they are 
        // instantiated 
        int dotIndex = loggerName.lastIndexOf('.');
        while (dotIndex >= 0) {
            final String parentName = loggerName.substring(0, dotIndex);
            if (getProperty(parentName + ".level") != null) {
                Logger.getLogger(parentName);