mirror of
https://github.com/community-scripts/ProxmoxVED.git
synced 2026-02-24 21:47:26 +00:00
Improve logging and error handling with session IDs
Introduces a SESSION_ID variable for log file naming and tracking, updates log file paths to include timestamps and session IDs, and enhances error handling output to use custom message functions when available. Also improves log file management and user guidance for viewing logs, and refactors error handler to better support containerized environments.
This commit is contained in:
@@ -27,7 +27,8 @@ variables() {
|
||||
DIAGNOSTICS="yes" # sets the DIAGNOSTICS variable to "yes", used for the API call.
|
||||
METHOD="default" # sets the METHOD variable to "default", used for the API call.
|
||||
RANDOM_UUID="$(cat /proc/sys/kernel/random/uuid)" # generates a random UUID and sets it to the RANDOM_UUID variable.
|
||||
CTTYPE="${CTTYPE:-${CT_TYPE:-1}}"
|
||||
SESSION_ID="${RANDOM_UUID:0:8}" # Short session ID (first 8 chars of UUID) for log files
|
||||
CTTYPE="${CTTYPE:-${CT_TYPE:-1}}"}
|
||||
|
||||
# Get Proxmox VE version and kernel version
|
||||
if command -v pveversion >/dev/null 2>&1; then
|
||||
@@ -2144,6 +2145,7 @@ build_container() {
|
||||
fi
|
||||
export DIAGNOSTICS="$DIAGNOSTICS"
|
||||
export RANDOM_UUID="$RANDOM_UUID"
|
||||
export SESSION_ID="$SESSION_ID"
|
||||
export CACHER="$APT_CACHER"
|
||||
export CACHER_IP="$APT_CACHER_IP"
|
||||
export tz="$timezone"
|
||||
|
||||
Reference in New Issue
Block a user