)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"87784f286309f70eff94571a71cf71840253f1fd","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":3,"id":"54eaf6b5_c9cd3e19","updated":"2026-10-15 12:24:59.000000000","message":"Honestly speaking I don\u0027t prefer maintaining that uwsgi specific logic, because it eventually requires us to vendor more server-specific logics when we try to use a new wsgi thing.\n\nInstead can we make log_file and log_dir configurable using environment variables ? You can bake the desired env vars in your systemd unit files.","commit_id":"570a7d9e09fe3e7b01cbe03b6da8c11f563fbfa7"},{"author":{"_account_id":6476,"name":"Thomas Goirand","email":"thomas@goirand.fr","username":"thomas-goirand"},"change_message_id":"3fd1f8ec37f7d00a749ba83e177aadec21c8d337","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"59ffca61_12a6f8a8","in_reply_to":"235a2ce5_64cce296","updated":"2026-10-16 06:20:49.000000000","message":"Done","commit_id":"570a7d9e09fe3e7b01cbe03b6da8c11f563fbfa7"},{"author":{"_account_id":6476,"name":"Thomas Goirand","email":"thomas@goirand.fr","username":"thomas-goirand"},"change_message_id":"8706d232529fec3e23019dcdbe9813c97f7deddf","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":3,"id":"235a2ce5_64cce296","in_reply_to":"54eaf6b5_c9cd3e19","updated":"2026-10-16 06:20:32.000000000","message":"I do set \"--log-file\" in my startup script (so no need for env var), but that\u0027s not the issue. The issue is, if one sets log_dir, but not log_file, then then log_file becomes \u0027\u003cfrozen importlib._bootstrap\u003e.log\u0027. This is completely wrong, and needs to be fixed. If you have better idea to double-guess the log_file variable, I\u0027m all for it, but we cannot leave things the way they are currently.","commit_id":"570a7d9e09fe3e7b01cbe03b6da8c11f563fbfa7"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"864ef3324300d0bf6d021447b11b692081396e29","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":3,"id":"aca8c5ad_e71070b2","in_reply_to":"59ffca61_12a6f8a8","updated":"2026-10-16 07:34:43.000000000","message":"It\u0027s the deployment decision to use uwsgi and file logging and I don\u0027t know if it\u0027s the good idea to maintain more logic for specific deployment pattern.\nIf you can use --log-dir then why not changing it to --log-file instead to get the desired log, instead of asking oslo.log to have that hack to \"guess\" ?\n\nI\u0027m for avoiding that ugly logging, but am not sure adding more guess-hack is the thing we want to maintain here.","commit_id":"570a7d9e09fe3e7b01cbe03b6da8c11f563fbfa7"}],"oslo_log/handlers.py":[{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"87784f286309f70eff94571a71cf71840253f1fd","unresolved":true,"context_lines":[{"line_number":72,"context_line":"        if not module:"},{"line_number":73,"context_line":"            return name"},{"line_number":74,"context_line":"        if isinstance(module, bytes):"},{"line_number":75,"context_line":"            module \u003d module.decode()"},{"line_number":76,"context_line":"        # Let\u0027s say we have \"module \u003d heat.wsgi.cfn:application\""},{"line_number":77,"context_line":"        # in our uwsgi .ini file, then we want to get \"heat-cfn\""},{"line_number":78,"context_line":"        # from it: strip the \":application\" part, replace the"},{"line_number":79,"context_line":"        # \".wsgi.\" sequence with a dash, and the remaining dots"},{"line_number":80,"context_line":"        # with dashes."},{"line_number":81,"context_line":"        modpath \u003d module.split(\":\", 1)[0]"},{"line_number":82,"context_line":"        modpath \u003d modpath.replace(\".wsgi.\", \"-\").replace(\".\", \"-\")"},{"line_number":83,"context_line":"        return modpath or name"},{"line_number":84,"context_line":"    except Exception:"},{"line_number":85,"context_line":"        return \"log-file-not-set\""}],"source_content_type":"text/x-python","patch_set":3,"id":"80c7c319_2e6fca4f","line":82,"range":{"start_line":75,"start_character":36,"end_line":82,"end_character":66},"updated":"2026-10-15 12:24:59.000000000","message":"While this is a common practice so far, I don\u0027t want us to maintain logic specific to it because we don\u0027t really enforce that pattern and anything unexpected may break things quite easily.\nI\u0027d rather use the bare module path, without modification (or replace only . at maximum)","commit_id":"570a7d9e09fe3e7b01cbe03b6da8c11f563fbfa7"},{"author":{"_account_id":6476,"name":"Thomas Goirand","email":"thomas@goirand.fr","username":"thomas-goirand"},"change_message_id":"8706d232529fec3e23019dcdbe9813c97f7deddf","unresolved":true,"context_lines":[{"line_number":72,"context_line":"        if not module:"},{"line_number":73,"context_line":"            return name"},{"line_number":74,"context_line":"        if isinstance(module, bytes):"},{"line_number":75,"context_line":"            module \u003d module.decode()"},{"line_number":76,"context_line":"        # Let\u0027s say we have \"module \u003d heat.wsgi.cfn:application\""},{"line_number":77,"context_line":"        # in our uwsgi .ini file, then we want to get \"heat-cfn\""},{"line_number":78,"context_line":"        # from it: strip the \":application\" part, replace the"},{"line_number":79,"context_line":"        # \".wsgi.\" sequence with a dash, and the remaining dots"},{"line_number":80,"context_line":"        # with dashes."},{"line_number":81,"context_line":"        modpath \u003d module.split(\":\", 1)[0]"},{"line_number":82,"context_line":"        modpath \u003d modpath.replace(\".wsgi.\", \"-\").replace(\".\", \"-\")"},{"line_number":83,"context_line":"        return modpath or name"},{"line_number":84,"context_line":"    except Exception:"},{"line_number":85,"context_line":"        return \"log-file-not-set\""}],"source_content_type":"text/x-python","patch_set":3,"id":"d3d33af2_057c20c2","line":82,"range":{"start_line":75,"start_character":36,"end_line":82,"end_character":66},"in_reply_to":"80c7c319_2e6fca4f","updated":"2026-10-16 06:20:32.000000000","message":"Ok, I can do that.","commit_id":"570a7d9e09fe3e7b01cbe03b6da8c11f563fbfa7"},{"author":{"_account_id":6476,"name":"Thomas Goirand","email":"thomas@goirand.fr","username":"thomas-goirand"},"change_message_id":"3fd1f8ec37f7d00a749ba83e177aadec21c8d337","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        if not module:"},{"line_number":73,"context_line":"            return name"},{"line_number":74,"context_line":"        if isinstance(module, bytes):"},{"line_number":75,"context_line":"            module \u003d module.decode()"},{"line_number":76,"context_line":"        # Let\u0027s say we have \"module \u003d heat.wsgi.cfn:application\""},{"line_number":77,"context_line":"        # in our uwsgi .ini file, then we want to get \"heat-cfn\""},{"line_number":78,"context_line":"        # from it: strip the \":application\" part, replace the"},{"line_number":79,"context_line":"        # \".wsgi.\" sequence with a dash, and the remaining dots"},{"line_number":80,"context_line":"        # with dashes."},{"line_number":81,"context_line":"        modpath \u003d module.split(\":\", 1)[0]"},{"line_number":82,"context_line":"        modpath \u003d modpath.replace(\".wsgi.\", \"-\").replace(\".\", \"-\")"},{"line_number":83,"context_line":"        return modpath or name"},{"line_number":84,"context_line":"    except Exception:"},{"line_number":85,"context_line":"        return \"log-file-not-set\""}],"source_content_type":"text/x-python","patch_set":3,"id":"3bf13ccd_2bde9bda","line":82,"range":{"start_line":75,"start_character":36,"end_line":82,"end_character":66},"in_reply_to":"d3d33af2_057c20c2","updated":"2026-10-16 06:20:49.000000000","message":"Done","commit_id":"570a7d9e09fe3e7b01cbe03b6da8c11f563fbfa7"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"87784f286309f70eff94571a71cf71840253f1fd","unresolved":true,"context_lines":[{"line_number":82,"context_line":"        modpath \u003d modpath.replace(\".wsgi.\", \"-\").replace(\".\", \"-\")"},{"line_number":83,"context_line":"        return modpath or name"},{"line_number":84,"context_line":"    except Exception:"},{"line_number":85,"context_line":"        return \"log-file-not-set\""},{"line_number":86,"context_line":""},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"class OSSysLogHandler(logging.Handler):"}],"source_content_type":"text/x-python","patch_set":3,"id":"ed55edc9_10fbf107","line":85,"range":{"start_line":85,"start_character":15,"end_line":85,"end_character":33},"updated":"2026-10-15 12:24:59.000000000","message":"Don\u0027t do this. This changes the behavior. You should return none.","commit_id":"570a7d9e09fe3e7b01cbe03b6da8c11f563fbfa7"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"864ef3324300d0bf6d021447b11b692081396e29","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        modpath \u003d modpath.replace(\".wsgi.\", \"-\").replace(\".\", \"-\")"},{"line_number":83,"context_line":"        return modpath or name"},{"line_number":84,"context_line":"    except Exception:"},{"line_number":85,"context_line":"        return \"log-file-not-set\""},{"line_number":86,"context_line":""},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"class OSSysLogHandler(logging.Handler):"}],"source_content_type":"text/x-python","patch_set":3,"id":"af61323c_96054383","line":85,"range":{"start_line":85,"start_character":15,"end_line":85,"end_character":33},"in_reply_to":"e12c1cdd_3242d58f","updated":"2026-10-16 07:34:43.000000000","message":"My concern here is that this logic is used in the other log handers and changing it also affects these.\nHowever I tried some small reproducer with sysloghandler and noticed that binary_name crashes it so maybe this is no harm for these.","commit_id":"570a7d9e09fe3e7b01cbe03b6da8c11f563fbfa7"},{"author":{"_account_id":6476,"name":"Thomas Goirand","email":"thomas@goirand.fr","username":"thomas-goirand"},"change_message_id":"8706d232529fec3e23019dcdbe9813c97f7deddf","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        modpath \u003d modpath.replace(\".wsgi.\", \"-\").replace(\".\", \"-\")"},{"line_number":83,"context_line":"        return modpath or name"},{"line_number":84,"context_line":"    except Exception:"},{"line_number":85,"context_line":"        return \"log-file-not-set\""},{"line_number":86,"context_line":""},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"class OSSysLogHandler(logging.Handler):"}],"source_content_type":"text/x-python","patch_set":3,"id":"e12c1cdd_3242d58f","line":85,"range":{"start_line":85,"start_character":15,"end_line":85,"end_character":33},"in_reply_to":"ed55edc9_10fbf107","updated":"2026-10-16 06:20:32.000000000","message":"I very much don\u0027t agree. The current logic to log to \u003cfrozen importlib._bootstrap\u003e is what needs to be fixed, returning None lead to that exactly.","commit_id":"570a7d9e09fe3e7b01cbe03b6da8c11f563fbfa7"},{"author":{"_account_id":9816,"name":"Takashi Kajinami","email":"kajinamit@oss.nttdata.com","username":"kajinamit"},"change_message_id":"2034a616d796291c6bdb177d4d90df4855482b14","unresolved":true,"context_lines":[{"line_number":57,"context_line":"}"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"def _get_binary_name() -\u003e str:"},{"line_number":61,"context_line":"    try:"},{"line_number":62,"context_line":"        name \u003d os.path.basename(sys.argv[0])"},{"line_number":63,"context_line":"        if \"uwsgi\" not in name:"},{"line_number":64,"context_line":"            return name"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        try:"},{"line_number":67,"context_line":"            import uwsgi"},{"line_number":68,"context_line":"        except ImportError:"},{"line_number":69,"context_line":"            return name"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        module \u003d uwsgi.opt.get(\"module\")"},{"line_number":72,"context_line":"        if not module:"},{"line_number":73,"context_line":"            return name"},{"line_number":74,"context_line":"        if isinstance(module, bytes):"},{"line_number":75,"context_line":"            module \u003d module.decode()"},{"line_number":76,"context_line":"        # Let\u0027s say we have \"module \u003d heat.wsgi.cfn:application\""},{"line_number":77,"context_line":"        # in our uwsgi .ini file, then we use \"heat.wsgi.cfn\" as"},{"line_number":78,"context_line":"        # the name: just strip the \":application\" part."},{"line_number":79,"context_line":"        modpath \u003d module.split(\":\", 1)[0]"},{"line_number":80,"context_line":"        return modpath or name"},{"line_number":81,"context_line":"    except Exception:"},{"line_number":82,"context_line":"        return \"log-file-not-set\""},{"line_number":83,"context_line":""},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"class OSSysLogHandler(logging.Handler):"},{"line_number":86,"context_line":"    \"\"\"Syslog based handler. Only available on UNIX-like platforms.\"\"\""}],"source_content_type":"text/x-python","patch_set":4,"id":"a02c6e33_6f283e3b","line":83,"range":{"start_line":60,"start_character":30,"end_line":83,"end_character":1},"updated":"2026-10-16 10:15:56.000000000","message":"As I mentioned in irc, I\u0027d suggest;\n\nKeep inspect.stack and check if it points to a file, then fallback to sys.argv[0] if not.\n\nThat would provide a predictable and human-readable result. if user\u0027s want to decide a tooling which requires them to use the same sys.argv[0] for multiple services then they can override file name by --log-file according to their architecture.","commit_id":"c987d6f84a57ba9735fd7dfa3c55415257900770"}]}
