[Feature] Allow the background log path to be specified

Abierto
#692 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@perfectmodelslab ya está trabajando en esto.

Desde el 25/10/2026.

  • #1059 de @perfectmodelslab — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
58/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
python
Área
cli

Línea de trabajo

Comienza con el punto de entrada del lanzamiento y sigue background_launch() hasta background_log_path(port); inspecciona _open_log_for_write() y cómo comfy logs lee la clave de configuración background_log. Decide si la variable de entorno o una opción de lanzamiento es la interfaz compatible y, a continuación, verifica que la ruta seleccionada quede registrada y que la protección existente contra el seguimiento de enlaces simbólicos siga intacta. Actualiza la documentación relevante de comfy logs si cambia el comportamiento.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
1k
Forks
176
Merge medio
1 d 11 h
PR fusionados (30 d)
87

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Comfy-Org/comfy-cli

Todos los issues de Comfy-Org/comfy-cli

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.