code: public static LoggerConfig[] setLogLevel(String loggerName, String level) {
      if(StringUtils.isBlank(loggerName)) {
        loggerName = ch.qos.logback.classic.Logger.ROOT_LOGGER_NAME;
      }
      LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
      log.debug("Setting {} to level {}", loggerName, level);
      ch.qos.logback.classic.Logger logger = null;
      try {
        logger = context.getLogger(loggerName);
        if(logger != null) {
          if(level.equals("null") || level.equals("none")) {
            logger.setLevel(null);
          } else {
            logger.setLevel(Level.toLevel(level));
          }
          logger = context.getLogger(loggerName);
          return new LoggerConfig[] {new LoggerConfig(logger.getName(), logger.getLevel() + "")};
        }
        return new LoggerConfig[] {};
      } catch(Throwable t) {
        log.warn("Failed to change log level for logger "+loggerName+" to level "+level, t);
        return new LoggerConfig[] {};
      }
    }
docs: Updates a logger with a given name to the given level.
  
  @param loggerName
  @param level