def METHOD_NAME(component, logging_level=logging.DEBUG):
    """ Configure logging
        :param component: name of a component
        :type component: str
        :param logging_level: loglevel
        :type logging_level: int
    """
    if not os.path.isdir(config.log_dir) or not os.access(config.log_dir, os.W_OK):
        log_handler = logging.NullHandler()
        log_file = ""
    else:
        log_file = os.path.join(config.log_dir, "%s.log" % component)
        rotate = os.path.isfile(log_file)
        log_handler = RotatingFileHandler(log_file, backupCount=5)
        log_handler.setLevel(logging_level)
        formatter = logging.Formatter('%(levelname)s:%(name)s: %(message)s')
        log_handler.setFormatter(formatter)
        if rotate:
            log_handler.doRollover()
    logger = logging.getLogger(component)
    logger.addHandler(log_handler)
    logger.setLevel(logging_level)
    return log_file, logger