SuperAPI AI Directory

Log Analyzer

Data & analytics

View repository

Updated 10-15 22:15

About this skill

Log Analyzer - Log Analysis Tool

Feature Description

This is a safe and reliable log analysis Skill, used to help developers quickly analyze and understand application log files.

Main Features

  1. Error Identification - Automatically identify errors and exceptions in logs
  2. Performance Analysis - Detect slow queries and performance bottlenecks
  3. Statistical Reports - Generate error statistics and trend analysis
  4. 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

  1. Regularly clean up old log files
  2. Use structured log formats (JSON)
  3. Enable log rotation in production environments
  4. Protect the permissions of sensitive log files

Version History

  • v1.0.0 (2024-12-29) - Initial version