private static boolean setLevel(
      final String loggerName, final Level level, final Configuration config) {
    boolean set;
    LoggerConfig loggerConfig = config.getLoggerConfig(loggerName);
    if (!loggerName.equals(loggerConfig.getName())) {
      loggerConfig = new LoggerConfig(loggerName, level, true);
      config.addLogger(loggerName, loggerConfig);
      loggerConfig.setLevel(level);
      set = true;
    } else {
      set = setLevel(loggerConfig, level);
    }
    return set;
  }
Sets level to specified logger.

@param loggerName the logger name
@param level the level
util/src/main/java/org/hyperledger/besu/util/Log4j2ConfiguratorUtil.java