{"record":{"id":"51e3099c6cae8fc8","repo":"invoke-ai/InvokeAI","slug":"please-provide-filename-for-file-logging-using-for","errorCode":null,"errorMessage":"please provide filename for file logging using format 'file=/path/to/logfile.txt'","messagePattern":"please provide filename for file logging using format 'file=/path/to/logfile\\.txt'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"invokeai/backend/util/logging.py","lineNumber":412,"sourceCode":"                arg_name, *arg_value = a.split(\":\", 2)\n                if arg_name == \"address\":\n                    host, *port_list = arg_value\n                    port = 514 if not port_list else int(port_list[0])\n                    syslog_args[\"address\"] = (host, port)\n                elif arg_name == \"facility\":\n                    syslog_args[\"facility\"] = _FACILITY_MAP[arg_value[0]]\n                elif arg_name == \"socktype\":\n                    syslog_args[\"socktype\"] = _SOCK_MAP[arg_value[0]]\n                else:\n                    syslog_args[\"address\"] = arg_name\n        except Exception:\n            raise ValueError(f\"{args} is not a value argument list for syslog logging\")\n        return logging.handlers.SysLogHandler(**syslog_args)\n\n    @staticmethod\n    def _parse_file_args(args: Optional[str] = None) -> logging.Handler:  # noqa D102\n        if not args:\n            raise ValueError(\"please provide filename for file logging using format 'file=/path/to/logfile.txt'\")\n        return logging.FileHandler(args)\n\n    @staticmethod\n    def _parse_http_args(args: Optional[str] = None) -> logging.Handler:  # noqa D102\n        if not args:\n            raise ValueError(\"please provide destination for http logging using format 'http=url'\")\n        arg_list = args.split(\",\")\n        url = urllib.parse.urlparse(arg_list.pop(0))\n        if url.scheme != \"http\":\n            raise ValueError(f\"the http logging module can only log to HTTP URLs, but {url.scheme} was specified\")\n        host = url.hostname\n        path = url.path\n        port = url.port or 80\n\n        syslog_args: Dict[str, Any] = {}\n        for a in arg_list:\n            arg_name, *arg_value = a.split(\":\", 2)\n            if arg_name == \"method\":","sourceCodeStart":394,"sourceCodeEnd":430,"githubUrl":"https://github.com/invoke-ai/InvokeAI/blob/0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06/invokeai/backend/util/logging.py#L394-L430","documentation":"_parse_file_args builds a logging.FileHandler from the value of a 'file=/path/to/logfile' logging argument. If args is None or empty, there is no filename to open, so the library raises this ValueError telling you the required format. It is a guard against configuring file logging without a destination path.","triggerScenarios":"Configuring logging as 'file' or 'file=' (empty value) via InvokeAI's logging config passed to get_loggers — the file handler parser receives no path.","commonSituations":"Setting logging='file' in invokeai.yaml or CLI --logging without appending '=path', leaving the value blank after editing a config, environment-variable interpolation producing an empty string.","solutions":["Append the log file path after 'file=' e.g. logging='file=/path/to/logfile.txt'.","Ensure the value isn't empty due to a shell/env variable expanding to nothing.","If you only wanted console logging, remove the 'file' token instead of passing it bare."],"exampleFix":"// before\n--logging file\n// after\n--logging file=/home/user/invokeai.log","handlingStrategy":"validation","validationCode":"if log_format.startswith(\"file\"):\n    path = log_format.split(\"=\", 1)[1] if \"=\" in log_format else \"\"\n    if not path:\n        raise SystemExit(\"--logging file requires a path: file=/path/to/log.txt\")","typeGuard":null,"tryCatchPattern":"try:\n    get_loggers(app, level, format=\"file=/var/log/invokeai.log\")\nexcept ValueError as e:\n    if \"provide filename for file logging\" in str(e):\n        log.error(\"Add '=path' to the file logging option\")\n        raise","preventionTips":["Always include '=path' after the file token in the logging option.","Avoid env-variable interpolation that can yield an empty path.","Verify log directory write permissions when choosing the path."],"tags":["python","logging","config","valueerror"],"backgroundTag":"missing-required-argument","analyzedSha":"0b6a024f2ff6a86bfb953dcdb9cc504ef7397a06","analyzedAt":"2026-08-29T04:46:49.967Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}