code: private static void disableHandler(final LogContextConfiguration configuration, final String handlerName) {
          final HandlerConfiguration handlerConfiguration = configuration.getHandlerConfiguration(handlerName);
          try {
              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)) {
                  disableHandlers.put(handlerName, handlerConfiguration.getFilter());
                  handlerConfiguration.setFilter(CommonAttributes.DENY.getName());
              }
          }
      }
docs: Disables the handler if the handler exists and is not already disabled.
  <p/>
  If the handler does not exist or is already disabled nothing happens.
  
  @param configuration the log context configuration.
  @param handlerName   the handler name to disable.