Package org.apache.logging.log4j

Examples of org.apache.logging.log4j.Level


    }

    private Result filter(final Level level) {
        final Object value = ThreadContext.get(key);
        if (value != null) {
            Level ctxLevel = levelMap.get(value);
            if (ctxLevel == null) {
                ctxLevel = defaultThreshold;
            }
            return level.isAtLeastAsSpecificAs(ctxLevel) ? onMatch : onMismatch;
        }
View Full Code Here


        final Result onMismatch = Result.toResult(mismatch);
        final Map<String, Level> map = new HashMap<String, Level>();
        for (final KeyValuePair pair : pairs) {
            map.put(pair.getKey(), Level.toLevel(pair.getValue()));
        }
        final Level level = Level.toLevel(levelName, Level.ERROR);
        return new DynamicThresholdFilter(key, map, level, onMatch, onMismatch);
    }
View Full Code Here

    public void testGetLevelReturnsOffIfNullLevelSet() {
        RingBufferLogEvent evt = new RingBufferLogEvent();
        String loggerName = null;
        Marker marker = null;
        String fqcn = null;
        Level level = null;
        Message data = null;
        Throwable t = null;
        Map<String, String> map = null;
        ContextStack contextStack = null;
        String threadName = null;
View Full Code Here

    public void testGetMessageReturnsNonNullMessage() {
        RingBufferLogEvent evt = new RingBufferLogEvent();
        String loggerName = null;
        Marker marker = null;
        String fqcn = null;
        Level level = null;
        Message data = null;
        Throwable t = null;
        Map<String, String> map = null;
        ContextStack contextStack = null;
        String threadName = null;
View Full Code Here

    public void testGetMillisReturnsConstructorMillisForNormalMessage() {
        RingBufferLogEvent evt = new RingBufferLogEvent();
        String loggerName = null;
        Marker marker = null;
        String fqcn = null;
        Level level = null;
        Message data = null;
        Throwable t = null;
        Map<String, String> map = null;
        ContextStack contextStack = null;
        String threadName = null;
View Full Code Here

    public void testGetMillisReturnsMsgTimestampForTimestampMessage() {
        RingBufferLogEvent evt = new RingBufferLogEvent();
        String loggerName = null;
        Marker marker = null;
        String fqcn = null;
        Level level = null;
        Message data = new TimeMsg("", 567);
        Throwable t = null;
        Map<String, String> map = null;
        ContextStack contextStack = null;
        String threadName = null;
View Full Code Here

        public BasicConfiguration() {

            final LoggerConfig root = getRootLogger();
            final String l = System.getProperty(DEFAULT_LEVEL);
            final Level level = (l != null && Level.getLevel(l) != null) ? Level.getLevel(l) : Level.ERROR;
            root.setLevel(level);
        }
View Full Code Here

   
    @Test
    public void testNullLevelReplacedWithOFF() throws Exception {
        final Marker marker = null;
        final Throwable t = null;
        final Level NULL_LEVEL = null;
        final Log4jLogEvent evt = new Log4jLogEvent("some.test", marker, "",
                NULL_LEVEL, new SimpleMessage("abc"), t);
        assertEquals(Level.OFF, evt.getLevel());
    }
View Full Code Here

        public BasicConfiguration() {
            final LoggerConfig root = getRootLogger();
            setName("BasicConfiguration");
            final String levelName = System.getProperty(DEFAULT_LEVEL);
            final Level level = (levelName != null && Level.getLevel(levelName) != null) ? Level.getLevel(levelName) : Level.DEBUG;
            root.setLevel(level);
        }
View Full Code Here

        public BasicConfiguration() {

            LoggerConfig root = getRootLogger();
            String l = System.getProperty(DEFAULT_LEVEL);
            Level level = (l != null && Level.valueOf(l) != null) ? Level.valueOf(l) : Level.ERROR;
            root.setLevel(level);
        }
View Full Code Here

TOP

Related Classes of org.apache.logging.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.