/** * Enables the handler if it was previously disabled. * <p/> * If it was not previously disable, nothing happens. * * @param configuration the log context configuration. * @param handlerName the name of the handler to enable. */ static void enableHandler(final LogContextConfiguration configuration, final String handlerName) { final HandlerConfiguration handlerConfiguration = configuration.getHandlerConfiguration(handlerName); try { handlerConfiguration.setPropertyValueString("enabled", "true"); return; } catch (IllegalArgumentException e) { // do nothing } final Map<String, String> disableHandlers = configuration.getLogContext().getAttachment(CommonAttributes.ROOT_LOGGER_NAME, DISABLED_HANDLERS_KEY); if (disableHandlers != null && disableHandlers.containsKey(handlerName)) { synchronized (HANDLER_LOCK) { final String filter = disableHandlers.get(handlerName); handlerConfiguration.setFilter(filter); disableHandlers.remove(handlerName); } } }
/** * Enables the handler if it was previously disabled. * <p/> * If it was not previously disable, nothing happens. * * @param configuration the log context configuration. * @param handlerName the name of the handler to enable. */ private static void enableHandler(final LogContextConfiguration configuration, final String handlerName) { final HandlerConfiguration handlerConfiguration = configuration.getHandlerConfiguration(handlerName); try { handlerConfiguration.setPropertyValueString("enabled", "true"); return; } catch (IllegalArgumentException e) { // do nothing } final Map<String, String> disableHandlers = configuration.getLogContext().getAttachment(CommonAttributes.ROOT_LOGGER_NAME, DISABLED_HANDLERS_KEY); if (disableHandlers != null && disableHandlers.containsKey(handlerName)) { synchronized (HANDLER_LOCK) { final String filter = disableHandlers.get(handlerName); handlerConfiguration.setFilter(filter); disableHandlers.remove(handlerName); } } }
/** * Enables the handler if it was previously disabled. * <p/> * If it was not previously disable, nothing happens. * * @param configuration the log context configuration. * @param handlerName the name of the handler to enable. */ private static void enableHandler(final LogContextConfiguration configuration, final String handlerName) { final HandlerConfiguration handlerConfiguration = configuration.getHandlerConfiguration(handlerName); try { handlerConfiguration.setPropertyValueString("enabled", "true"); return; } catch (IllegalArgumentException e) { // do nothing } final Map<String, String> disableHandlers = configuration.getLogContext().getAttachment(CommonAttributes.ROOT_LOGGER_NAME, DISABLED_HANDLERS_KEY); if (disableHandlers != null && disableHandlers.containsKey(handlerName)) { synchronized (HANDLER_LOCK) { final String filter = disableHandlers.get(handlerName); handlerConfiguration.setFilter(filter); disableHandlers.remove(handlerName); } } }
} else if (PROPERTIES.getName().equals(attributeName)) { for (Property property : value.asPropertyList()) { configuration.setPropertyValueString(property.getName(), property.getValue().asString());
final HandlerConfiguration handlerConfiguration = configuration.getHandlerConfiguration(handlerName); try { handlerConfiguration.setPropertyValueString("enabled", "false"); return; } catch (IllegalArgumentException e) {
final HandlerConfiguration handlerConfiguration = configuration.getHandlerConfiguration(handlerName); try { handlerConfiguration.setPropertyValueString("enabled", "false"); return; } catch (IllegalArgumentException e) {
final HandlerConfiguration handlerConfiguration = configuration.getHandlerConfiguration(handlerName); try { handlerConfiguration.setPropertyValueString("enabled", "false"); return; } catch (IllegalArgumentException e) {
configuration = logContextConfiguration.addHandlerConfiguration("org.jboss.as.logging", Log4jAppenderHandler.class.getName(), name); configuration.addPostConfigurationMethod(Log4jAppenderHandler.ACTIVATE_OPTIONS_METHOD_NAME); configuration.setPropertyValueString("appender", name); } else { configuration.setPropertyValueString("closeChildren", "false");
configuration = logContextConfiguration.addHandlerConfiguration("org.jboss.as.logging", Log4jAppenderHandler.class.getName(), name); configuration.addPostConfigurationMethod(Log4jAppenderHandler.ACTIVATE_OPTIONS_METHOD_NAME); configuration.setPropertyValueString("appender", name); } else { configuration.setPropertyValueString("closeChildren", "false");
configuration.setPropertyValueString(Log4jAppenderHandler.ACTIVATOR_PROPERTY_METHOD_NAME, "");
configuration.setPropertyValueString(Log4jAppenderHandler.ACTIVATOR_PROPERTY_METHOD_NAME, "");
configuration.setPropertyValueString("appender", name); } else {
configuration.setPropertyValueString(Log4jAppenderHandler.ACTIVATOR_PROPERTY_METHOD_NAME, ""); configuration.setPropertyValueString(configurationProperty.getPropertyName(), null); configuration.removeProperty(configurationProperty.getPropertyName()); } else { configuration.setPropertyValueString(configurationProperty.getPropertyName(), resolvedValue);
configuration.setPropertyValueString(Log4jAppenderHandler.ACTIVATOR_PROPERTY_METHOD_NAME, ""); configuration.setPropertyValueString(configurationProperty.getPropertyName(), null); configuration.removeProperty(configurationProperty.getPropertyName()); } else { configuration.setPropertyValueString(configurationProperty.getPropertyName(), resolvedValue);