<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _add_filehandler(logger, logpath, formatter=None, name="Bench"):
 """ Adds a FileHandler to logger. :param logger: Logger. :param logpath: Path to file. :param formatter: Formatter to be used :param name: Name for logger :return: Logger """

    formatter = formatter if formatter else BenchFormatterWithType(loggername=name)
    handler = _get_filehandler_with_formatter(logpath, formatter)
    config = LOGGING_CONFIG.get(name, {}).get("file", DEFAULT_LOGGING_CONFIG.get("file"))
    handler.setLevel(getattr(logging, config.get("level", "DEBUG")))
    logger.addHandler(handler)
    return logger