Files
nexus/wiki/concepts/Log-Driven-Debugging.md
2026-04-23 04:02:48 +08:00

30 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Log-Driven Debugging"
type: concept
last_updated: 2026-04-10
---
## Definition
Log-Driven Debugging 是一种通过系统日志定位问题根因的调试方法,尤其适用于分布式系统和多层配置架构。当错误信息具有误导性时,日志是最直接的系统状态反映。
## Key Insight
> **日志真的有用Gateway 日志把问题写得明明白白,只是我自己没仔细看。**
## OpenClaw Gateway Log Example
```
provider=custom-api-deepseek-reasoner/deepseek-reasoner ctx=16000
estimatedPromptTokens=393 overflowTokens=392 reserveTokens=16384
```
这条日志直接揭示了:
1. 当前模型已被切换为 deepseek-reasoner
2. 模型 context window 为 16K
3. Safeguard 预留 16K tokens 导致 overflow
## Related
- [[Error-Surface-vs-Root-Cause]]: 日志帮助还原真实根因
- [[Hidden-Failure-Paths]]: 日志是发现隐藏故障路径的唯一可靠手段
- [[Layered-Configuration]]: 日志帮助识别配置层级问题
## Sources
- [[养虾日记4-一次「context-limit-exceeded」错误排查-我以为是小问题-结果踩了大坑]]