def METHOD_NAME(self, opts):
    """ Reset the loglevel if it has changed in the config file. """
    # Get loglevel setting from app.config.
    config_loglevel = opts.get("loglevel", None)
    # If loglevel setting is configured.
    if config_loglevel:
        # Check if it's a valid setting
        if hasattr(logging, config_loglevel.upper()):
            # Get root logger instance
            root_logger = logging.getLogger()
            # If level is different set loglevel to new value.
            if logging.getLevelName(root_logger.level) != config_loglevel.upper():
                root_logger.setLevel(config_loglevel.upper())
        else:
            LOG.error("Invalid app.config setting for loglevel %s", config_loglevel)