[Feature] Allow the background log path to be specified

Đang mở
#692 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@perfectmodelslab đang làm issue này rồi.

Từ ngày 25/10/2026.

  • #1059 của @perfectmodelslab — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
58/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
python
Lĩnh vực
cli

Hướng nghiên cứu

Bắt đầu từ điểm vào khởi chạy và lần theo background_launch() đến background_log_path(port); kiểm tra _open_log_for_write() và cách comfy logs đọc khóa cấu hình background_log. Xác định xem biến môi trường hay tùy chọn khởi chạy là giao diện được hỗ trợ, sau đó xác minh rằng đường dẫn được chọn được ghi lại và cơ chế bảo vệ hiện có chống việc đi theo liên kết tượng trưng vẫn còn nguyên vẹn. Cập nhật tài liệu comfy logs liên quan nếu hành vi thay đổi.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement

What

comfy launch --background writes ComfyUI's output to
<workspace>/user/comfyui_<port>.log, and there is currently no way to ask for a
different path. A --log-file option on launch, or an env var honoured by
background_log_path(), would let a supervising process keep that log wherever it
keeps its others.

Why

comfy-cli is increasingly something else starts — a project launcher, a dev
script, a systemd unit. Those supervisors usually have one convention for where
their managed services log (/tmp/<name>.log, /var/log/<name>/, a run
directory), and ComfyUI is the one participant whose log lands somewhere else, in
a location that also moves with the workspace.

In our case (a launcher that starts piper / ollama / a Chatterbox bridge / ComfyUI
side by side) every other helper announces (logs: /tmp/<name>.log) on startup
and points back there on failure. ComfyUI can't, so we symlink /tmp/comfyui.log
at comfy-cli's file instead. That works fine — this is a convenience request, not
a defect report.

Current state, for reference

  • launch exposes --background and --frontend-pr; no log option.
  • background_launch() computes log_path = background_log_path(port)
    unconditionally.
  • The background_log config key looks like it might be an input, but it's
    written by comfy-cli after launch and read back only by comfy logs to locate
    the file.

Suggested shape

Either is fine; the env var alone would cover the supervisor case:

def background_log_path(port, workspace: str | None = None) -> str:
    override = os.environ.get("COMFY_BACKGROUND_LOG")
    if override:
        return os.path.abspath(override)
    ...

One thing worth preserving

_open_log_for_write() opens with O_NOFOLLOW so a pre-placed symlink in
<workspace>/user can't be used to clobber its target — a good defence, and an
override path should keep it rather than special-casing "trusted" locations. Worth
saying explicitly in the docs for such an option: the override must be a real
file path, not a symlink
, or the launch fails with ELOOP.

That behaviour is also why the workaround has to point the other way (a symlink
at comfy-cli's file, never the workspace path symlinked outward) — which is
easy to get backwards, and might deserve a line in the comfy logs docs
regardless of whether this request is taken up.

Ngôn ngữ chính
Python
Star
1k
Fork
176
Merge trung bình
1 ngày 11 giờ
Pull request đã merge (30 ngày)
87

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Comfy-Org/comfy-cli

Tất cả issue của Comfy-Org/comfy-cli

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.