Package org.jboss.logmanager

Examples of org.jboss.logmanager.Logger


        final ServiceController<Logger> controller = (ServiceController<Logger>) serviceRegistry.getService(LogServices.handlerName(name));
        if (controller == null) {
            return false;
        }
        // Get the logger
        final Logger logger = controller.getValue();
        if (LEVEL.getName().equals(attributeName)) {
            logger.setLevel(ModelParser.parseLevel(resolvedValue));
        } else if (FILTER.getName().equals(attributeName)) {
            logger.setFilter(ModelParser.parseFilter(context, resolvedValue));
        }
        return false;
    }
View Full Code Here


        return useParentHandlers;
    }

    public synchronized void setUseParentHandlers(final boolean useParentHandlers) {
        this.useParentHandlers = useParentHandlers;
        final Logger logger = getLogger();
        if (logger != null) {
            logger.setUseParentHandlers(useParentHandlers);
        }
    }
View Full Code Here

        return level;
    }

    public synchronized void setLevel(final Level level) {
        this.level = level;
        final Logger logger = getLogger();
        if (logger != null) {
            logger.setLevel(level);
        }
    }
View Full Code Here

        return level;
    }

    public synchronized void setLevel(final Level level) {
        this.level = level;
        final Logger logger = getLogger();
        if (logger != null) {
            logger.setLevel(level);
        }
    }
View Full Code Here

        return notNull(getLogger());
    }

    public synchronized void setFilter(final Filter filter) {
        this.filter = filter;
        final Logger logger = this.logger;
        if (logger != null) {
            logger.setFilter(filter);
        }
    }
View Full Code Here

        final ServiceController<Logger> controller = (ServiceController<Logger>) serviceRegistry.getService(LogServices.loggerName(name));
        if (controller == null) {
            return false;
        }
        // Get the logger
        final Logger logger = controller.getValue();
        if (LEVEL.getName().equals(attributeName)) {
            logger.setLevel(ModelParser.parseLevel(resolvedValue));
        } else if (FILTER.getName().equals(attributeName)) {
            logger.setFilter(ModelParser.parseFilter(context, resolvedValue));
        } else if (USE_PARENT_HANDLERS.getName().equals(attributeName)) {
            logger.setUseParentHandlers(resolvedValue.asBoolean());
        }
        return false;
    }
View Full Code Here

    }

    @Override
    public StdioContext getStdioContext() {
        final LogContext logContext = LogContext.getLogContext();
        final Logger root = logContext.getLogger(CommonAttributes.ROOT_LOGGER_NAME);
        StdioContext stdioContext = root.getAttachment(STDIO_CONTEXT_ATTACHMENT_KEY);
        if (stdioContext == null) {
            stdioContext = StdioContext.create(
                    new NullInputStream(),
                    new LoggingOutputStream(logContext.getLogger("stdout"), Level.INFO),
                    new LoggingOutputStream(logContext.getLogger("stderr"), Level.ERROR)
            );
            final StdioContext appearing = root.attachIfAbsent(STDIO_CONTEXT_ATTACHMENT_KEY, stdioContext);
            if (appearing != null) {
                stdioContext = appearing;
            }
        }
        return stdioContext;
View Full Code Here

     * @param logContext the log context used to find the property configurator or to attach it to.
     *
     * @return the property configurator
     */
    public static ConfigurationPersistence getOrCreateConfigurationPersistence(final LogContext logContext) {
        final Logger root = logContext.getLogger(CommonAttributes.ROOT_LOGGER_NAME);
        ConfigurationPersistence result = (ConfigurationPersistence) root.getAttachment(Configurator.ATTACHMENT_KEY);
        if (result == null) {
            result = new ConfigurationPersistence(logContext);
            ConfigurationPersistence existing = (ConfigurationPersistence) root.attachIfAbsent(Configurator.ATTACHMENT_KEY, result);
            if (existing != null) {
                result = existing;
            }
        }
        return result;
View Full Code Here

            handlerConfiguration.setPropertyValueString("enabled", "false");
            return;
        } catch (IllegalArgumentException e) {
            // do nothing
        }
        final Logger root = configuration.getLogContext().getLogger(CommonAttributes.ROOT_LOGGER_NAME);
        Map<String, String> disableHandlers = root.getAttachment(DISABLED_HANDLERS_KEY);
        synchronized (HANDLER_LOCK) {
            if (disableHandlers == null) {
                disableHandlers = new HashMap<String, String>();
                final Map<String, String> current = root.attachIfAbsent(DISABLED_HANDLERS_KEY, disableHandlers);
                if (current != null) {
                    disableHandlers = current;
                }
            }
            if (!disableHandlers.containsKey(handlerName)) {
View Full Code Here

        return level;
    }

    public synchronized void setLevel(final Level level) {
        this.level = level;
        final Logger logger = getLogger();
        if (logger != null) {
            logger.setLevel(level);
        }
    }
View Full Code Here

TOP

Related Classes of org.jboss.logmanager.Logger

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.