public LocalLog(String className) {
		// get the last part of the class name
		this.className = LoggerFactory.getSimpleClassName(className);

		Level level = null;
		if (classLevels != null) {
			for (PatternLevel patternLevel : classLevels) {
				if (patternLevel.pattern.matcher(className).matches()) {
					// if level has not been set or the level is lower...
					if (level == null || patternLevel.level.ordinal() < level.ordinal()) {
						level = patternLevel.level;
					}
				}
			}
		}

		if (level == null) {
			// see if we have a level set
			String levelName = System.getProperty(LOCAL_LOG_LEVEL_PROPERTY);
			if (levelName == null) {
				level = DEFAULT_LEVEL;
			} else {
				Level matchedLevel;
				try {
					matchedLevel = Level.valueOf(levelName.toUpperCase());
				} catch (IllegalArgumentException e) {
					throw new IllegalArgumentException("Level '" + levelName + "' was not found", e);
				}
				level = matchedLevel;
			}
		}
		this.level = level;
	}