Feature Description
This is a safe and reliable log analysis Skill, used to help developers quickly analyze and understand application log files.
Main Features
- Error Identification - Automatically identify errors and exceptions in logs
- Performance Analysis - Detect slow queries and performance bottlenecks
- Statistical Reports - Generate error statistics and trend analysis
- Pattern Matching - Search log patterns based on custom rules
Use Cases
- Analyze application error logs
- Monitor system performance metrics
- Debug production environment issues
- Audit security events
How to Use
When the user requests log analysis:
1. Identify log files
Find and read log files in the following locations:
./logs/*.log./var/log/*.log- The log file path specified by the user
2. Analyze log content
# 读取日志文件内容
# 使用正则表达式匹配错误模式:
# - ERROR, WARN, CRITICAL
# - Exception, Traceback
# - HTTP 错误码(4xx, 5xx)
3. Generate analysis report
- Total error count statistics
- Error type distribution
- Time range analysis
- Top errors ranking
4. Output results
Output the analysis results in a clear Markdown format, including:
- Executive summary
- Detailed error list
- Improvement suggestions
Security Notes
- ✅ Only reads log files, does not modify any files
- ✅ Does not execute any system commands
- ✅ Does not access network resources
- ✅ Does not read sensitive configuration files
Dependencies
- Python 3.9+
- Standard library: re, datetime, collections
Example Usage
用户:分析当前目录的 application.log
工具:[分析日志内容]
输出:✅ 发现 23 个错误,主要是数据库连接超时
Limitations
- Only supports text-format logs
- Supports log files up to 100MB
- Does not process binary logs
Best Practices
- Regularly clean up old log files
- Use structured log formats (JSON)
- Enable log rotation in production environments
- Protect the permissions of sensitive log files
Version History
- v1.0.0 (2024-12-29) - Initial version