Package org.apache.logging.log4j

Examples of org.apache.logging.log4j.Level


            LOGGER.error("Loggers cannot be configured without a name");
            return null;
        }

        final List<AppenderRef> appenderRefs = Arrays.asList(refs);
        Level level;
        try {
            level = Level.toLevel(levelName, Level.ERROR);
        } catch (final Exception ex) {
            LOGGER.error(
                    "Invalid Log level specified: {}. Defaulting to Error",
View Full Code Here


                @PluginElement("appender-ref") final AppenderRef[] refs,
                @PluginElement("properties") final Property[] properties,
                @PluginConfiguration final Configuration config,
                @PluginElement("filters") final Filter filter) {
            final List<AppenderRef> appenderRefs = Arrays.asList(refs);
            Level level;
            try {
                level = Level.toLevel(levelName, Level.ERROR);
            } catch (final Exception ex) {
                LOGGER.error(
                        "Invalid Log level specified: {}. Defaulting to Error",
View Full Code Here

        if (ref == null) {
            LOGGER.error("Appender references must contain a reference");
            return null;
        }
        Level level = null;

        if (levelName != null) {
            level = Level.toLevel(levelName, null);
            if (level == null) {
                LOGGER.error("Invalid level " + levelName + " on Appender reference " + ref);
View Full Code Here

            if (root.size() == 1) {
                final Iterator<JsonNode> i = root.getElements();
                root = i.next();
            }
            processAttributes(rootNode, root);
            Level status = Level.OFF;
            boolean verbose = false;
            PrintStream stream = System.out;
            for (final Map.Entry<String, String> entry : rootNode.getAttributes().entrySet()) {
                if ("status".equalsIgnoreCase(entry.getKey())) {
                    status = Level.toLevel(getSubst().replace(entry.getValue()), null);
View Full Code Here

            final String[] pair = def.split("=");
            if (pair == null || pair.length != 2) {
                LOGGER.error("Invalid option {}", def);
                continue;
            }
            final Level level = Level.toLevel(pair[0].trim(), null);
            if (level == null) {
                LOGGER.error("Invalid Level {}", pair[0].trim());
            }
            levelMap.put(level, pair[1].trim());
        }
        if (levelMap.size() == 0) {
            return INSTANCE;
        }
        for (final Level level : Level.values()) {
            if (!levelMap.containsKey(level)) {
                levelMap.put(level, level.toString());
            }
        }
        return new LevelPatternConverter(levelMap);
    }
View Full Code Here

     * {@inheritDoc}
     */
    @Override
    public String getStyleClass(final Object e) {
        if (e instanceof LogEvent) {
            final Level level = ((LogEvent) e).getLevel();

            switch (level) {
                case TRACE:
                    return "level trace";

View Full Code Here

            LOGGER.error("Loggers cannot be configured without a name");
            return null;
        }

        final List<AppenderRef> appenderRefs = Arrays.asList(refs);
        Level level;
        try {
            level = Level.toLevel(levelName, Level.ERROR);
        } catch (final Exception ex) {
            LOGGER.error(
                    "Invalid Log level specified: {}. Defaulting to Error",
View Full Code Here

                @PluginElement("appender-ref") final AppenderRef[] refs,
                @PluginElement("properties") final Property[] properties,
                @PluginConfiguration final Configuration config,
                @PluginElement("filters") final Filter filter) {
            final List<AppenderRef> appenderRefs = Arrays.asList(refs);
            Level level;
            try {
                level = Level.toLevel(levelName, Level.ERROR);
            } catch (final Exception ex) {
                LOGGER.error(
                        "Invalid Log level specified: {}. Defaulting to Error",
View Full Code Here

                        Arrays.toString(STYLES.keySet().toArray()));
                } else {
                    levelStyles.putAll(enumMap);
                }
            } else {
                final Level level = Level.toLevel(key);
                if (level == null) {
                    LOGGER.error("Unknown level name: " + key + ". Use one of " +
                        Arrays.toString(DEFAULT_STYLES.keySet().toArray()));
                } else {
                    levelStyles.put(level, value);
View Full Code Here

            LOGGER.error("Loggers cannot be configured without a name");
            return null;
        }

        final List<AppenderRef> appenderRefs = Arrays.asList(refs);
        Level level;
        try {
            level = Level.toLevel(levelName, Level.ERROR);
        } catch (final Exception ex) {
            LOGGER.error(
                    "Invalid Log level specified: {}. Defaulting to Error",
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.