
When you're staring at thousands of log lines trying to figure out why production is broken, this skill automates the grunt work. It detects common log formats (nginx, Spring Boot, JSON, syslog), clusters similar errors so you're not reading the same stack trace 89 times, and looks for timing patterns that suggest root causes. The workflow is solid: it filters by time and severity, extracts response times and status codes, then generates a markdown report with top errors and potential causes. The best part is the causal chain analysis, where it tries to connect a database timeout to the cascade of NPEs that followed. Just watch out for large files since it processes everything in memory.
$ npx -y skills add laolaoshiren/claude-code-skills-zh --skill log-analyzer --agent claude-codeInstalls into .claude/skills of the current project.
当用户要求以下操作时激活此技能:
自动检测日志格式:
## 📊 日志分析报告
### 概览
- 时间范围: 2024-01-15 10:00 ~ 12:00
- 总日志量: 12,847 条
- 错误数: 234 (1.8%)
- 警告数: 567 (4.4%)
### Top 5 异常
| 排名 | 错误类型 | 次数 | 首次出现 | 最近出现 |
|------|---------|------|---------|---------|
| 1 | NullPointerException | 89 | 10:15 | 11:42 |
| 2 | ConnectionTimeout | 67 | 10:23 | 11:58 |
### 根因分析
最可能的原因:数据库连接池耗尽(线索:连续出现 ConnectionTimeout 后跟大量 NullPointerException)
### 建议
1. 检查数据库连接池配置(当前可能 maxActive 太小)
2. 排查是否存在连接泄漏
3. 添加连接池监控告警
Sponsors