Examples of ContextSelector


Examples of org.apache.logging.log4j.core.selector.ContextSelector

    private static final StatusLogger LOGGER = StatusLogger.getLogger();

    public List<LoggerContext> getLoggerContexts() {
        Log4jContextFactory factory = (Log4jContextFactory) LogManager.getFactory();
        ContextSelector selector = factory.getSelector();
        return selector.getLoggerContexts();
    }
View Full Code Here

Examples of org.apache.logging.log4j.core.selector.ContextSelector

        }
        if (context.getAttribute(Log4jContextListener.LOG4J_CONTEXT_ATTRIBUTE) == null) {
            LoggerContext ctx;
            final LoggerContextFactory factory = LogManager.getFactory();
            if (factory instanceof Log4jContextFactory) {
                final ContextSelector sel = ((Log4jContextFactory) factory).getSelector();
                if (sel instanceof NamedContextSelector) {
                    selector = (NamedContextSelector) sel;
                    ctx = selector.locateContext(name, configLocn);
                } else {
                    return;
View Full Code Here

Examples of org.apache.logging.log4j.core.selector.ContextSelector

    public void stop() {
       
        // LOG4J2-392 first stop AsyncLogger Disruptor thread
        final LoggerContextFactory factory = LogManager.getFactory();
        if (factory instanceof Log4jContextFactory) {
            ContextSelector selector = ((Log4jContextFactory) factory).getSelector();
            if (selector instanceof AsyncLoggerContextSelector) { // all loggers are async
                // TODO until LOG4J2-493 is fixed we can only stop AsyncLogger once!
                // but LoggerContext.setConfiguration will call config.stop()
                // every time the configuration changes...
                //
View Full Code Here

Examples of org.apache.logging.log4j.core.selector.ContextSelector

        }

        LoggerContext loggerContext;
        final LoggerContextFactory factory = LogManager.getFactory();
        if (factory instanceof Log4jContextFactory) {
            final ContextSelector selector = ((Log4jContextFactory) factory).getSelector();
            if (selector instanceof NamedContextSelector) {
                this.selector = (NamedContextSelector) selector;
                loggerContext = this.selector.locateContext(this.name, this.servletContext, configLocation);
                ContextAnchor.THREAD_CONTEXT.set(loggerContext);
                if (loggerContext.getStatus() == LoggerContext.Status.INITIALIZED) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.