From 6bdb5922fac0d72b99254534b4b1136cdbfd436d Mon Sep 17 00:00:00 2001 From: anti Date: Wed, 8 Apr 2026 01:42:05 -0400 Subject: [PATCH] fix: ensure shared log volume mount by default and disable container-side rotation --- decnet/cli.py | 2 +- templates/decnet_logging.py | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/decnet/cli.py b/decnet/cli.py index 11da13c..5f181aa 100644 --- a/decnet/cli.py +++ b/decnet/cli.py @@ -244,7 +244,7 @@ def deploy( distro: Optional[str] = typer.Option(None, "--distro", help="Comma-separated distro slugs, e.g. debian,ubuntu22,rocky9"), randomize_distros: bool = typer.Option(False, "--randomize-distros", help="Assign a random distro to each decky"), log_target: Optional[str] = typer.Option(None, "--log-target", help="Forward logs to ip:port (e.g. 192.168.1.5:5140)"), - log_file: Optional[str] = typer.Option(None, "--log-file", help="Write RFC 5424 syslog to this path inside containers (e.g. /var/log/decnet/decnet.log)"), + log_file: Optional[str] = typer.Option(DECNET_INGEST_LOG_FILE, "--log-file", help="Write RFC 5424 syslog to this path inside containers (e.g. /var/log/decnet/decnet.log)"), archetype_name: Optional[str] = typer.Option(None, "--archetype", "-a", help="Machine archetype slug (e.g. linux-server, windows-workstation)"), mutate_interval: Optional[int] = typer.Option(30, "--mutate-interval", help="Automatically rotate services every N minutes"), dry_run: bool = typer.Option(False, "--dry-run", help="Generate compose file without starting containers"), diff --git a/templates/decnet_logging.py b/templates/decnet_logging.py index ff05fd8..3625089 100644 --- a/templates/decnet_logging.py +++ b/templates/decnet_logging.py @@ -103,10 +103,8 @@ def _get_file_logger() -> logging.Logger: log_path = Path(os.environ.get(_LOG_FILE_ENV, _DEFAULT_LOG_FILE)) try: log_path.parent.mkdir(parents=True, exist_ok=True) - handler = logging.handlers.RotatingFileHandler( + handler = logging.FileHandler( log_path, - maxBytes=_MAX_BYTES, - backupCount=_BACKUP_COUNT, encoding="utf-8", ) except OSError: @@ -132,10 +130,8 @@ def _get_json_logger() -> logging.Logger: json_path = Path(log_path_str).with_suffix(".json") try: json_path.parent.mkdir(parents=True, exist_ok=True) - handler = logging.handlers.RotatingFileHandler( + handler = logging.FileHandler( json_path, - maxBytes=_MAX_BYTES, - backupCount=_BACKUP_COUNT, encoding="utf-8", ) except OSError: