def METHOD_NAME(config: Config, handler_cls: str = "logging.FileHandler") -> None:
    """
    Set up the logging configuration based on the input `config` object
    and an optional `handler_cls` argument.
    Args:
        config: A `Config` object that contains the logging configuration parameters.
        handler_cls: A string representing the class of the logging handler.
    """
    logging_config: Dict[str, Any] = {
        "version": 1,
        "disable_existing_loggers": False,
        "formatters": {
            "console": {
                "class": "antarest.core.logging.utils.CustomDefaultFormatter",
                "format": (
                    "[%(asctime)s] [%(process)s] [%(name)s]"
                    " - %(trace_id)s"
                    " - %(threadName)s"
                    " - %(ip)s"
                    " - %(user)s"
                    " - %(levelname)s"
                    " - %(message)s"
                ),
            },
            "json": {
                "class": "pythonjsonlogger.jsonlogger.JsonFormatter",
                "format": (
                    "%(asctime)s"
                    " - %(process)s"
                    " - %(name)s"
                    " - %(trace_id)s"
                    " - %(threadName)s"
                    " - %(ip)s"
                    " - %(user)s"
                    " - %(levelname)s"
                    " - %(message)s"
                ),
            },
        },
        "handlers": {
            "default": {
                "class": "logging.StreamHandler",
                "formatter": "console",
                "level": "INFO",
                "stream": "ext://sys.stdout",
                "filters": ["context"],
            },
        },
        "filters": {
            "context": {
                "()": "antarest.core.logging.utils.ContextFilter",
            }
        },
        "loggers": {
            "": {  # root logger
                "handlers": ["default"],
                "level": "INFO",
                "propagate": True,
            },
            "antarest.study.storage.rawstudy.watcher": {
                "handlers": ["default"],
                "level": "WARN",
                "propagate": True,
            },
        },
    }
    if config.logging.logfile is not None:
        if handler_cls == "logging.FileHandler":
            logging_config["handlers"]["default"] = {
                "class": handler_cls,
                "formatter": "console",
                "level": "INFO",
                "filename": config.logging.logfile,
                "filters": ["context"],
            }
        elif handler_cls == "logging.handlers.TimedRotatingFileHandler":
            logging_config["handlers"]["default"] = {
                "class": handler_cls,
                "filename": config.logging.logfile,
                "when": "D",  # D = day
                "interval": 90,  # 90 days = 3 months
                "backupCount": 1,  # keep only 1 backup (0 means keep all)
                "encoding": "utf-8",
                "delay": False,
                "utc": False,
                "atTime": None,
                "formatter": "console",
                "level": "INFO",
                "filters": ["context"],
            }
        else:  # pragma: no cover
            raise NotImplementedError(handler_cls)
    if config.logging.level is not None and config.logging.level in [
        "INFO",
        "WARNING",
        "ERROR",
        "DEBUG",
    ]:
        logging_config["loggers"][""]["level"] = config.logging.level
    if config.logging.json:
        logging_config["handlers"]["default"]["formatter"] = "json"
    logging.config.dictConfig(logging_config)