private static Logger doLegacyGetLogger(final String name) { final org.jboss.logmanager.Logger lmLogger = LogContext.getLogContext().getLogger(""); ConcurrentMap<String, Logger> loggers = lmLogger.getAttachment(LEGACY_KEY); if (loggers == null) { loggers = new ConcurrentHashMap<String, Logger>(); final ConcurrentMap<String, Logger> appearing = lmLogger.attachIfAbsent(LEGACY_KEY, loggers); if (appearing != null) { loggers = appearing; } } Logger l = loggers.get(name); if (l != null) { return l; } final org.jboss.logmanager.Logger logger = org.jboss.logmanager.Logger.getLogger(name); l = new JBossLogManagerLogger(name, logger); final Logger appearing = loggers.putIfAbsent(name, l); if (appearing == null) { return l; } return appearing; }
private static Logger doGetLogger(final String name) { Logger l = LogContext.getLogContext().getAttachment(name, KEY); if (l != null) { return l; } final org.jboss.logmanager.Logger logger = org.jboss.logmanager.Logger.getLogger(name); l = new JBossLogManagerLogger(name, logger); Logger a = logger.attachIfAbsent(KEY, l); if (a == null) { return l; } else { return a; } }
@Override public LogContext run() { return LogContext.getLogContext(); } };
/** * Get or create a logger with the given name. * * @param name the logger name * @return the corresponding logger */ public Logger getLogger(String name) { return LogContext.getLogContext().getLogger(name); }
@Override public Enumeration<String> getLoggerNames() { return LogContext.getLogContext().getLoggerNames(); }
/** * Gets the property configurator. If the {@link ConfigurationPersistence} does not exist a new one is created. * * @return the property configurator */ public static ConfigurationPersistence getOrCreateConfigurationPersistence() { return getOrCreateConfigurationPersistence(LogContext.getLogContext()); }
public static WildFlyLogContextSelector create() { // Use the current log context as the default, not LogContext.DEFAULT_LOG_CONTEXT_SELECTOR // This allows embedding use cases to control the log context return new WildFlyLogContextSelectorImpl(LogContext.getLogContext()); }
/** * Gets the property configurator. If the {@link ConfigurationPersistence} does not exist a new one is created. * * @return the property configurator */ public static ConfigurationPersistence getOrCreateConfigurationPersistence() { return getOrCreateConfigurationPersistence(LogContext.getLogContext()); }
public static WildFlyLogContextSelector create() { // Use the current log context as the default, not LogContext.DEFAULT_LOG_CONTEXT_SELECTOR // This allows embedding use cases to control the log context return new WildFlyLogContextSelectorImpl(LogContext.getLogContext()); }
/** * Gets the property configurator. If the {@link ConfigurationPersistence} does not exist a new one is created. * * @return the property configurator */ public static ConfigurationPersistence getOrCreateConfigurationPersistence() { return getOrCreateConfigurationPersistence(LogContext.getLogContext()); }
public Logger exists(final String name) { final org.jboss.logmanager.Logger lmLogger = LogContext.getLogContext().getLoggerIfExists(name); if (lmLogger == null) { return null; } return create(lmLogger); }
public LogContextStdioContextSelector(final StdioContext defaultContext) { // Register the STDIO context on the default log context LogContext.getLogContext().getLogger(CommonAttributes.ROOT_LOGGER_NAME).attachIfAbsent(STDIO_CONTEXT_ATTACHMENT_KEY, defaultContext); }
public LogContextStdioContextSelector(final StdioContext defaultContext) { // Register the STDIO context on the default log context LogContext.getLogContext().getLogger(CommonAttributes.ROOT_LOGGER_NAME).attachIfAbsent(STDIO_CONTEXT_ATTACHMENT_KEY, defaultContext); }
public LogContextStdioContextSelector(final StdioContext defaultContext) { // Register the STDIO context on the default log context LogContext.getLogContext().getLogger(CommonAttributes.ROOT_LOGGER_NAME).attachIfAbsent(STDIO_CONTEXT_ATTACHMENT_KEY, defaultContext); }
public Logger getLogger(final String name) { final org.jboss.logmanager.Logger lmLogger = LogContext.getLogContext().getLogger(name); final Logger logger = lmLogger.getAttachment(reposKey); if (logger != null) { return logger; } return create(lmLogger); }
private static Logger doGetLogger(final String name) { Logger l = LogContext.getLogContext().getAttachment(name, KEY); if (l != null) { return l; } final org.jboss.logmanager.Logger logger = org.jboss.logmanager.Logger.getLogger(name); l = new JBossLogManagerLogger(name, logger); Logger a = logger.attachIfAbsent(KEY, l); if (a == null) { return l; } else { return a; } }
private static Logger doGetLogger(final String name) { Logger l = LogContext.getLogContext().getAttachment(name, KEY); if (l != null) { return l; } final org.jboss.logmanager.Logger logger = org.jboss.logmanager.Logger.getLogger(name); l = new JBossLogManagerLogger(name, logger); Logger a = logger.attachIfAbsent(KEY, l); if (a == null) { return l; } else { return a; } }
private static Logger doGetLogger(final String name) { Logger l = LogContext.getLogContext().getAttachment(name, KEY); if (l != null) { return l; } final org.jboss.logmanager.Logger logger = org.jboss.logmanager.Logger.getLogger(name); l = new JBossLogManagerLogger(name, logger); Logger a = logger.attachIfAbsent(KEY, l); if (a == null) { return l; } else { return a; } }
private static ConfigurationPersistence getConfigurationPersistence(final OperationContext context) { final PathAddress address = context.getCurrentAddress(); final LogContext logContext; if (LoggingProfileOperations.isLoggingProfileAddress(address)) { logContext = LoggingProfileContextSelector.getInstance().get(LoggingProfileOperations.getLoggingProfileName(address)); } else { logContext = LogContext.getLogContext(); } return ConfigurationPersistence.getConfigurationPersistence(logContext); }
private static ConfigurationPersistence getConfigurationPersistence(final OperationContext context) { final PathAddress address = context.getCurrentAddress(); final LogContext logContext; if (LoggingProfileOperations.isLoggingProfileAddress(address)) { logContext = LoggingProfileContextSelector.getInstance().get(LoggingProfileOperations.getLoggingProfileName(address)); } else { logContext = LogContext.getLogContext(); } return ConfigurationPersistence.getConfigurationPersistence(logContext); }