Package org.apache.logging.log4j.spi

Examples of org.apache.logging.log4j.spi.LoggerContext


    private final ConcurrentMap<String, Object> attributes = new ConcurrentHashMap<String, Object>();

    @Override
    public Log getInstance(final String name) throws LogConfigurationException {
        final LoggerContext context = PrivateManager.getContext();
        final ConcurrentMap<String, Log> loggers = getLoggersMap();
        if (loggers.containsKey(name)) {
            return loggers.get(name);
        }
        final org.apache.logging.log4j.Logger logger = PrivateManager.getLogger(name);
View Full Code Here


        throw new LogConfigurationException(
            "Commons Logging Adapter requires base logging system to extend Log4j AbstractLogger");
    }

    private ConcurrentMap<String, Log> getLoggersMap() {
        final LoggerContext context = PrivateManager.getContext();
        synchronized (contextMap) {
            ConcurrentMap<String, Log> map = contextMap.get(context);
            if (map == null) {
                map = new ConcurrentHashMap<String, Log>();
                contextMap.put(context, map);
View Full Code Here

    private final Map<LoggerContext, ConcurrentMap<String, Logger>> contextMap =
        new WeakHashMap<LoggerContext, ConcurrentMap<String, Logger>>();

    public Logger getLogger(final String name) {
        final LoggerContext context = getContext();
        final ConcurrentMap<String, Logger> loggers = getLoggersMap(context);

        if (loggers.containsKey(name)) {
            return loggers.get(name);
        }
        final String key = Logger.ROOT_LOGGER_NAME.equals(name) ? LogManager.ROOT_LOGGER_NAME : name;
        final org.apache.logging.log4j.Logger logger = context.getLogger(key);
        if (logger instanceof AbstractLogger) {
            loggers.putIfAbsent(name, new SLF4JLogger((AbstractLogger) logger, name));
            return loggers.get(name);
        }
        throw new SLF4JLoggingException("SLF4J Adapter requires base logging system to extend Log4J AbstractLogger");
View Full Code Here

    private final Map<LoggerContext, ConcurrentMap<String, Logger>> contextMap =
        new WeakHashMap<LoggerContext, ConcurrentMap<String, Logger>>();

    @Override
    public Logger getLogger(final String name) {
        final LoggerContext context = getContext();
        final ConcurrentMap<String, Logger> loggers = getLoggersMap(context);

        if (loggers.containsKey(name)) {
            return loggers.get(name);
        }
        final String key = Logger.ROOT_LOGGER_NAME.equals(name) ? LogManager.ROOT_LOGGER_NAME : name;
        final org.apache.logging.log4j.Logger logger = context.getLogger(key);
        if (logger instanceof AbstractLogger) {
            loggers.putIfAbsent(name, new SLF4JLogger((AbstractLogger) logger, name));
            return loggers.get(name);
        }
        throw new SLF4JLoggingException("SLF4J Adapter requires base logging system to extend Log4J AbstractLogger");
View Full Code Here

    private final ConcurrentMap<String, Object> attributes = new ConcurrentHashMap<String, Object>();

    @Override
    public Log getInstance(final String name) throws LogConfigurationException {
        final LoggerContext context = PrivateManager.getContext();
        final ConcurrentMap<String, Log> loggers = getLoggersMap();
        if (loggers.containsKey(name)) {
            return loggers.get(name);
        }
        final org.apache.logging.log4j.Logger logger = PrivateManager.getLogger(name);
View Full Code Here

        throw new LogConfigurationException(
            "Commons Logging Adapter requires base logging system to extend Log4J AbstractLogger");
    }

    private ConcurrentMap<String, Log> getLoggersMap() {
        final LoggerContext context = PrivateManager.getContext();
        synchronized (contextMap) {
            ConcurrentMap<String, Log> map = contextMap.get(context);
            if (map == null) {
                map = new ConcurrentHashMap<String, Log>();
                contextMap.put(context, map);
View Full Code Here

    private ConcurrentMap<String, Object> attributes = new ConcurrentHashMap<String, Object>();

    @Override
    public Log getInstance(String name) throws LogConfigurationException {
        LoggerContext context = PrivateManager.getContext();
        ConcurrentMap<String, Log> loggers = getLoggersMap();
        if (loggers.containsKey(name)) {
            return loggers.get(name);
        }
        org.apache.logging.log4j.Logger logger = PrivateManager.getLogger(name);
View Full Code Here

        throw new LogConfigurationException(
            "SLF4J Adapter requires base logging system to extend Log4J AbstractLogger");
    }

    private ConcurrentMap<String, Log> getLoggersMap() {
        LoggerContext context = PrivateManager.getContext();
        synchronized (contextMap) {
            ConcurrentMap<String, Log> map = contextMap.get(context);
            if (map == null) {
                map = new ConcurrentHashMap<String, Log>();
                contextMap.put(context, map);
View Full Code Here

    private final Map<LoggerContext, ConcurrentMap<String, Logger>> contextMap =
        new WeakHashMap<LoggerContext, ConcurrentMap<String, Logger>>();

    @Override
    public Logger getLogger(final String name) {
        final LoggerContext context = getContext();
        final ConcurrentMap<String, Logger> loggers = getLoggersMap(context);

        if (loggers.containsKey(name)) {
            return loggers.get(name);
        }
        final String key = Logger.ROOT_LOGGER_NAME.equals(name) ? LogManager.ROOT_LOGGER_NAME : name;
        final org.apache.logging.log4j.Logger logger = context.getLogger(key);
        if (logger instanceof AbstractLogger) {
            loggers.putIfAbsent(name, new SLF4JLogger((AbstractLogger) logger, name));
            return loggers.get(name);
        }
        throw new SLF4JLoggingException("SLF4J Adapter requires base logging system to extend Log4j AbstractLogger");
View Full Code Here

        throw new LogConfigurationException(
            "Commons Logging Adapter requires base logging system to extend Log4j AbstractLogger");
    }

    private ConcurrentMap<String, Log> getLoggersMap() {
        final LoggerContext context = PrivateManager.getContext();
        synchronized (contextMap) {
            ConcurrentMap<String, Log> map = contextMap.get(context);
            if (map == null) {
                map = new ConcurrentHashMap<String, Log>();
                contextMap.put(context, map);
View Full Code Here

TOP

Related Classes of org.apache.logging.log4j.spi.LoggerContext

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.