Package org.apache.log4j

Examples of org.apache.log4j.Level


     * specified as {@link XLevel#TRACE}.
     */
    public void testToLevel() {
        assertSame("XLevel.TRACE is returned if null name is passed", XLevel.toLevel(null), XLevel.TRACE);
        assertSame("XLevel.TRACE is returned if the name is equal to \"TRACE\" irrespective of case", XLevel.toLevel("trAce"), XLevel.TRACE);
        Level levelResults = Level.toLevel("MOCK", XLevel.TRACE);
        Level xLevelResults = XLevel.toLevel("MOCK");
        assertSame("In all other cases conversion is deferred to Level", xLevelResults, levelResults);
        assertSame("If conversion fails XLevel.TRACE is returned", xLevelResults, XLevel.TRACE);
    }
View Full Code Here


     * Tests that in other cases the conversion is deferred to {@link Level#toLevel(int)}
     * Tests that if conversion fails the {@link Level#DEBUG} is returned.
     */
    public void testToLevelInt() {
        assertSame("XLevel.TRACE is returned is " + TRACE_INT + "is passed", XLevel.toLevel(TRACE_INT), XLevel.TRACE);
        Level levelResults = Level.toLevel(MOCK_INT);
        Level xLevelResults = XLevel.toLevel(MOCK_INT);
        assertSame("In all other cases conversion is deferred to Level", xLevelResults, levelResults);
        assertSame("If conversion fails Level.DEBUG is returned", xLevelResults, Level.DEBUG);
    }
View Full Code Here

    /**
     * Gets the level of the root logger.
     */
    public synchronized String getRootLoggerLevel() {
        Level level = LogManager.getRootLogger().getLevel();

        if (level != null) {
            return level.toString();
        }

        return null;
    }
View Full Code Here

    public String getLoggerEffectiveLevel(final String logger) {
        if (logger == null) {
            throw new IllegalArgumentException("logger is null");
        }

        Level level = LogManager.getLogger(logger).getEffectiveLevel();

        if (level != null) {
            return level.toString();
        }

        return null;
    }
View Full Code Here

    public String getLoggerLevel(final String logger) {
        if (logger == null) {
            throw new IllegalArgumentException("logger is null");
        }

        Level level = LogManager.getLogger(logger).getLevel();

        if (level != null) {
            return level.toString();
        }

        return null;
    }
View Full Code Here

    /**
     * Gets the level of the root logger.
     */
    public synchronized String getRootLoggerLevel() {
        Level level = LogManager.getRootLogger().getLevel();

        if (level != null) {
            return level.toString();
        }

        return null;
    }
View Full Code Here

    public String getLoggerEffectiveLevel(final String logger) {
        if (logger == null) {
            throw new IllegalArgumentException("logger is null");
        }

        Level level = LogManager.getLogger(logger).getEffectiveLevel();

        if (level != null) {
            return level.toString();
        }

        return null;
    }
View Full Code Here

    public String getLoggerLevel(final String logger) {
        if (logger == null) {
            throw new IllegalArgumentException("logger is null");
        }

        Level level = LogManager.getLogger(logger).getLevel();

        if (level != null) {
            return level.toString();
        }

        return null;
    }
View Full Code Here

        return liveEps;
    }

    public void setLog4jLevel(String classQualifier, String rawLevel)
    {
        Level level = Level.toLevel(rawLevel);
        org.apache.log4j.Logger.getLogger(classQualifier).setLevel(level);
        logger_.info("set log level to " + level + " for classes under '" + classQualifier + "' (if the level doesn't look like '" + rawLevel + "' then log4j couldn't parse '" + rawLevel + "')");
    }
View Full Code Here

        return liveEps;
    }

    public void setLog4jLevel(String classQualifier, String rawLevel)
    {
        Level level = Level.toLevel(rawLevel);
        org.apache.log4j.Logger.getLogger(classQualifier).setLevel(level);
        logger_.info("set log level to " + level + " for classes under '" + classQualifier + "' (if the level doesn't look like '" + rawLevel + "' then log4j couldn't parse '" + rawLevel + "')");
    }
View Full Code Here

TOP

Related Classes of org.apache.log4j.Level

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.