fix(core): 强制所有业务模块日志与独立战报使用绝对 UTC 时间,彻底根除跨时区排障时的时间线错乱

This commit is contained in:
hotyue
2026-04-27 02:28:41 +00:00
parent 38869e8681
commit 332765a72e
4 changed files with 7 additions and 4 deletions
+2 -1
View File
@@ -27,7 +27,8 @@ if ! type log >/dev/null 2>&1; then
# 日志格式注入 [版本号] 追踪标识
local core_msg=$(printf "[v%-5s] [%-5s] [%-7s] [%s] %s" "$local_ver" "$2" "$1" "$REGION_CODE" "$3")
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $core_msg" >> "${INSTALL_DIR}/logs/sentinel.log"
# [时区对齐] 强制无视本地时区,以绝对 UTC 时间写入日志
echo "[$(date -u '+%Y-%m-%d %H:%M:%S UTC')] $core_msg" >> "${INSTALL_DIR}/logs/sentinel.log"
# 强制推送到 Systemd Journal (如果系统支持)
if command -v logger >/dev/null 2>&1; then