From 60f9622998ad8da19223fc051948767fd4836121 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Mon, 23 Feb 2026 16:07:13 +0100 Subject: [PATCH] fix(core): keep host-side logging on BUILD_LOG after INSTALL_LOG export After 'export INSTALL_LOG' in build.func, get_active_logfile() returned the container's INSTALL_LOG path for all host-side logging, causing msg_info/msg_ok/msg_error on the host to write to /root/.install-SESSION.log (the host file, not the container's) instead of BUILD_LOG. This made BUILD_LOG incomplete and get_full_log() unable to send full traces. Fix: Add _HOST_LOGFILE (not exported, invisible to container) so the host always logs to BUILD_LOG. Container still uses INSTALL_LOG as before. --- misc/build.func | 7 +++++++ misc/core.func | 12 ++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/misc/build.func b/misc/build.func index 8b6a7a69a..e61d2c649 100644 --- a/misc/build.func +++ b/misc/build.func @@ -3578,6 +3578,13 @@ build_container() { # DEV_MODE exports (optional, for debugging) export BUILD_LOG="$BUILD_LOG" export INSTALL_LOG="/root/.install-${SESSION_ID}.log" + + # Keep host-side logging on BUILD_LOG (not exported — invisible to container) + # Without this, get_active_logfile() would return INSTALL_LOG (a container path) + # and all host msg_info/msg_ok/msg_error would write to /root/.install-SESSION.log + # on the HOST instead of BUILD_LOG, causing incomplete telemetry logs. + _HOST_LOGFILE="$BUILD_LOG" + export dev_mode="${dev_mode:-}" export DEV_MODE_MOTD="${DEV_MODE_MOTD:-false}" export DEV_MODE_KEEP="${DEV_MODE_KEEP:-false}" diff --git a/misc/core.func b/misc/core.func index 23c318fd9..33ac1752b 100644 --- a/misc/core.func +++ b/misc/core.func @@ -395,12 +395,20 @@ ssh_check() { # get_active_logfile() # # - Returns the appropriate log file based on execution context -# - BUILD_LOG: Host operations (container creation) +# - _HOST_LOGFILE: Override for host context (keeps host logging on BUILD_LOG +# even after INSTALL_LOG is exported for the container) # - INSTALL_LOG: Container operations (application installation) +# - BUILD_LOG: Host operations (container creation) # - Fallback to BUILD_LOG if neither is set # ------------------------------------------------------------------------------ get_active_logfile() { - if [[ -n "${INSTALL_LOG:-}" ]]; then + # Host override: _HOST_LOGFILE is set (not exported) in build.func to keep + # host-side logging in BUILD_LOG after INSTALL_LOG is exported for the container. + # Without this, all host msg_info/msg_ok/msg_error would write to + # /root/.install-SESSION.log (a container path) instead of BUILD_LOG. + if [[ -n "${_HOST_LOGFILE:-}" ]]; then + echo "$_HOST_LOGFILE" + elif [[ -n "${INSTALL_LOG:-}" ]]; then echo "$INSTALL_LOG" elif [[ -n "${BUILD_LOG:-}" ]]; then echo "$BUILD_LOG"