mirror of
https://github.com/hotyue/IP-Sentinel.git
synced 2026-07-09 22:51:28 +08:00
fix(core): 强制所有业务模块日志与独立战报使用绝对 UTC 时间,彻底根除跨时区排障时的时间线错乱
This commit is contained in:
@@ -36,7 +36,7 @@ log() {
|
||||
|
||||
# 日志格式注入 [版本号] 追踪标识
|
||||
local core_msg=$(printf "[v%-5s] [%-5s] [%-7s] [%s] %s" "$local_ver" "$level" "$module" "$REGION_CODE" "$msg")
|
||||
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $core_msg" >> "$LOG_FILE"
|
||||
echo "[$(date -u '+%Y-%m-%d %H:%M:%S UTC')] $core_msg" >> "$LOG_FILE"
|
||||
|
||||
# 强制推送到 Systemd Journal (如果系统支持)
|
||||
if command -v logger >/dev/null 2>&1; then
|
||||
|
||||
Reference in New Issue
Block a user