code: public void setLoggerLevel(String loggerName, String level) throws Exception {
  
          final Address addr = Address.root().add(SUBSYSTEM, LOGGING, LOGGER, loggerName);
          final ModelNode request;
  
          if (isLogger(loggerName)) {
              request = createWriteAttributeRequest("level", level, addr);
          } else {
              final String dmrTemplate = "" //
                  + "{" //
                  + "\"category\" => \"%s\" " //
                  + ", \"level\" => \"%s\" " //
                  + ", \"use-parent-handlers\" => \"true\" " //
                  + "}";
              final String dmr = String.format(dmrTemplate, loggerName, level);
  
              request = ModelNode.fromString(dmr);
              request.get(OPERATION).set(ADD);
              request.get(ADDRESS).set(addr.getAddressNode());
          }
  
          final ModelNode response = execute(request);
          if (!isSuccess(response)) {
              throw new FailureException(response);
          }
          return;
      }
docs: Sets the logger to the given level.
  If the logger does not exist yet, it will be created.
  
  @param loggerName the logger name (this is also known as the category name)
  @param level the new level of the logger (e.g. DEBUG, INFO, ERROR, etc.)
  @throws Exception any error