feat: Introduce unified logging system and optimize file management
- Added a new unified logging module to standardize log formatting, including support for traceId and MDC for better tracking. - Updated `.gitignore` to exclude code analysis reports and temporary files. - Created cleanup scripts to manage unused files and generate cleanup reports. - Enhanced existing modules to integrate the new logging system and improve debugging capabilities. - Removed outdated files and scripts to streamline the project structure.
This commit is contained in:
1 parent
08a0b41834
commit
e5a510d19b
45 files changed
+18285
-1357
No files matched your search
@@ -949,6 +949,20 @@ async function pollStats() {
|
||||
}
|
||||
setTextIfExists("statLastLog", fmtTime(s.last_log_ts));
|
||||
setTextIfExists("statExitCode", (s.exit_code === null || typeof s.exit_code === "undefined") ? "-" : s.exit_code);
|
||||
|
||||
// 显示traceId和MDC信息
|
||||
const traceId = s.trace_id || "-";
|
||||
setTextIfExists("statTraceId", traceId);
|
||||
const mdcContext = s.mdc_context || {};
|
||||
if ($("statTraceIdHint")) {
|
||||
const mdcKeys = Object.keys(mdcContext);
|
||||
if (mdcKeys.length > 0) {
|
||||
const mdcStr = mdcKeys.map(k => `${k}=${mdcContext[k]}`).join(", ");
|
||||
$("statTraceIdHint").textContent = `MDC: ${mdcStr}`;
|
||||
} else {
|
||||
$("statTraceIdHint").textContent = "";
|
||||
}
|
||||
}
|
||||
|
||||
const c = s.counters || {};
|
||||
const getC = (k) => Number.isFinite(Number(c[k])) ? Number(c[k]) : 0;
|
||||
|
||||
@@ -327,6 +327,11 @@
|
||||
<div class="statLabel">退出码</div>
|
||||
<div id="statExitCode" class="statValue">-</div>
|
||||
</div>
|
||||
<div class="stat">
|
||||
<div class="statLabel">TraceId(请求追踪)</div>
|
||||
<div id="statTraceId" class="statValue" style="font-family: monospace; font-size: 0.9em;">-</div>
|
||||
<div class="statHint" id="statTraceIdHint">-</div>
|
||||
</div>
|
||||
|
||||
<div class="stat">
|
||||
<div class="statLabel">福袋:识别次数</div>
|
||||
|
||||
Reference in new issue
Block a user