Skip to content
Back to skills

Log Analyzer

ASecurity

智能日志分析工具,帮助快速定位应用错误和性能瓶颈

  • 167 stars
  • 0 votes
  • 0 copies
  • 19 views
  • Added February 6, 2026
developmentpython

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned February 12, 2026

npx -y skills add huifer/skill-security-scan --skill log-analyzer --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Log Analyzer?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Log Analyzer
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/huifer-log-analyzer/badge)](https://www.skillsdirectory.com/skills/huifer-log-analyzer)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: "Log Analyzer"
description: "智能日志分析工具,帮助快速定位应用错误和性能瓶颈"
author: "WellAlly Tech"
version: "1.0.0"
---

# Log Analyzer - 日志分析工具

## 功能描述
这是一个安全可靠的日志分析 Skill,用于帮助开发者快速分析和理解应用日志文件。

## 主要功能
1. **错误识别** - 自动识别日志中的错误和异常
2. **性能分析** - 检测慢查询和性能瓶颈
3. **统计报告** - 生成错误统计和趋势分析
4. **模式匹配** - 根据自定义规则搜索日志模式

## 使用场景
- 分析应用错误日志
- 监控系统性能指标
- 调试生产环境问题
- 审计安全事件

## 使用方法

当用户要求分析日志时:

### 1. 识别日志文件
查找并读取以下位置的日志文件:
- `./logs/*.log`
- `./var/log/*.log`
- 用户指定的日志文件路径

### 2. 分析日志内容
```python
# 读取日志文件内容
# 使用正则表达式匹配错误模式:
# - ERROR, WARN, CRITICAL
# - Exception, Traceback
# - HTTP 错误码(4xx, 5xx)
```

### 3. 生成分析报告
- 错误总数统计
- 错误类型分布
- 时间范围分析
- Top 错误排行

### 4. 输出结果
以清晰的 Markdown 格式输出分析结果,包括:
- 执行摘要
- 详细错误列表
- 改进建议

## 安全说明
- ✅ 只读取日志文件,不修改任何文件
- ✅ 不执行任何系统命令
- ✅ 不访问网络资源
- ✅ 不读取敏感配置文件

## 依赖项
- Python 3.9+
- 标准库:re, datetime, collections

## 示例用法

```
用户:分析当前目录的 application.log
工具:[分析日志内容]
输出:✅ 发现 23 个错误,主要是数据库连接超时
```

## 限制
- 仅支持文本格式日志
- 最大支持 100MB 的日志文件
- 不处理二进制日志

## 最佳实践
1. 定期清理旧日志文件
2. 使用结构化日志格式(JSON)
3. 在生产环境启用日志轮转
4. 保护敏感日志文件权限

---

## 版本历史
- v1.0.0 (2024-12-29) - 初始版本

Files in this skill

  • README.md563 B
  • SKILL.md2 KB
  • utils/log_parser.py4.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.