public LoggerContext apply(LogLevelConfig logLevelConfig, Props props) {
    if (!ROOT_LOGGER_NAME.equals(logLevelConfig.getRootLoggerName())) {
      throw new IllegalArgumentException("Value of LogLevelConfig#rootLoggerName must be \"" + ROOT_LOGGER_NAME + "\"");
    }

    LoggerContext rootContext = getRootContext();
    logLevelConfig.getConfiguredByProperties().forEach((key, value) -> applyLevelByProperty(props, rootContext.getLogger(key), value));
    logLevelConfig.getConfiguredByHardcodedLevel().forEach((key, value) -> applyHardcodedLevel(rootContext, key, value));
    Level propertyValueAsLevel = getPropertyValueAsLevel(props, LOG_LEVEL.getKey());
    boolean traceGloballyEnabled = propertyValueAsLevel == Level.TRACE;
    logLevelConfig.getOffUnlessTrace().forEach(logger -> applyHardUnlessTrace(rootContext, logger, traceGloballyEnabled));
    return rootContext;
  }
@Test
  public void apply_fails_with_IAE_if_process_property_has_unsupported_level() {
    LogLevelConfig config = newLogLevelConfig().rootLevelFor(WEB_SERVER).build();

    props.set("sonar.log.level.web", "ERROR");

    assertThatThrownBy(() -> underTest.apply(config, props))
      .isInstanceOf(IllegalArgumentException.class)
      .hasMessage("log level ERROR in property sonar.log.level.web is not a supported value (allowed levels are [TRACE, DEBUG, INFO])");
  }