← 返回
未分类 Key 中文

Error Log Analyzer

AI-powered error log analyzer that explains errors in plain English and provides actionable fix suggestions. Supports Node.js, Python, and Go log formats.
AI驱动的错误日志分析器,用通俗易懂的语言解释错误并提供可行的修复建议。支持Node.js、Python和Go日志格式。
janseling janseling 来源
未分类 clawhub v1.2.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 222
下载
💾 1
安装
1
版本
#ai#debugging#developer-tools#error-tracking#latest

概述

Error Log Analyzer - AI-Powered Debugging Assistant

What it does

This skill analyzes your application error logs using AI to:

  • 🤖 Explain errors in plain English - No more cryptic stack traces
  • 🔍 Identify error patterns - Find recurring issues automatically
  • 💡 Provide fix suggestions - Get actionable solutions with code examples
  • 🎯 Filter noise - Focus on critical issues, ignore duplicates
  • 📊 Track trends - Monitor error frequency over time

Quick Start

Installation

clawhub install janseling/error-log-analyzer

Basic Usage

Option 1: Paste logs directly

Analyze these error logs:
[2026-03-06 10:23:45] ERROR: Connection refused to database at localhost:5432
[2026-03-06 10:23:46] ERROR: Failed to reconnect after 3 attempts

Option 2: Upload log file

Analyze the error log file at /var/log/myapp/error.log

Option 3: Real-time monitoring

Monitor my application logs at /var/log/myapp/ and alert me on critical errors

Features

Supported Log Formats

  • Node.js: Winston, Bunyan, Pino, console.log
  • Python: logging module, structlog, loguru
  • Go: standard library log, zap, logrus
  • Auto-detection: Automatically identifies log format

AI-Powered Analysis

  • Error Explanation: Translates technical jargon into understandable explanations
  • Severity Assessment: Classifies errors as Critical, High, Medium, or Low
  • Root Cause Analysis: Identifies underlying issues causing errors
  • Fix Suggestions: Provides specific solutions with code examples

Pattern Recognition

  • Error Clustering: Groups similar errors together
  • Trend Detection: Spots spikes in error frequency
  • Duplicate Filtering: Reduces noise by hiding repeated errors
  • Correlation Analysis: Links related errors across services

Smart Filtering

  • Ignore known/expected errors
  • Focus on new or worsening issues
  • Filter by severity, service, or time range
  • Custom filtering rules

Configuration

Environment Variables

# Required for AI features
ANTHROPIC_API_KEY=your_key_here
# or
OPENAI_API_KEY=your_key_here

# Optional
ERROR_ANALYZER_CACHE_ENABLED=true
ERROR_ANALYZER_MAX_ERRORS=10000
ERROR_ANALYZER_SEVERITY_THRESHOLD=medium

Custom Settings

Create .error-analyzer.yml in your project root:

analysis:
  enableAI: true
  cacheResults: true
  maxConcurrentRequests: 5

filtering:
  ignorePatterns:
    - "GET /health"
    - "Connection reset by peer"
  
  severityOverrides:
    "ECONNREFUSED": high
    "ETIMEDOUT": medium

output:
  format: html  # or json, markdown
  includeStackTraces: true
  maxSuggestions: 3

Examples

Example 1: Node.js Application

Input:

2026-03-06 14:23:11 error: UnhandledPromiseRejectionWarning: Error: ECONNREFUSED
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16)
    at Database.connect (/app/src/db.js:45:12)
    at async initApp (/app/src/index.js:23:5)

Output:

🔴 CRITICAL: Database Connection Failed

What happened:
Your application tried to connect to a database at localhost:5432, but the 
connection was refused. This means the database server is either not running 
or not accepting connections.

Why it matters:
This is a critical issue that will prevent your app from functioning. Users 
will see errors or timeouts when trying to use any feature that needs the database.

How to fix it:
1. Check if PostgreSQL is running:
   sudo systemctl status postgresql

2. Start the database if it's stopped:
   sudo systemctl start postgresql

3. Verify the connection settings in your .env file:
   DATABASE_URL=postgresql://user:password@localhost:5432/dbname

4. Test the connection manually:
   psql -h localhost -p 5432 -U user -d dbname

Prevention:
- Add health checks to detect database issues early
- Implement connection pooling with retry logic
- Set up monitoring for database availability

Example 2: Python Application

Input:

2026-03-06 09:15:33,456 - django.request - ERROR - Internal Server Error: /api/users/
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/app/views.py", line 45, in get_users
    users = User.objects.filter(active=True).values('id', 'name', 'email')
OperationalError: no such table: auth_user

Output:

🔴 CRITICAL: Database Schema Error

What happened:
Your Django application tried to query the User table, but the table doesn't 
exist in your database. This typically means database migrations haven't been run.

Why it matters:
This error will cause all user-related functionality to fail, including login, 
registration, and user profile pages.

How to fix it:
1. Run Django migrations:
   python manage.py makemigrations
   python manage.py migrate

2. If using a fresh database, create a superuser:
   python manage.py createsuperuser

3. Verify the table exists:
   python manage.py dbshell
   > .tables
   > SELECT * FROM auth_user LIMIT 1;

Prevention:
- Add migration checks to your CI/CD pipeline
- Use pre-commit hooks to detect missing migrations
- Document database setup in your README

API Reference

Analyze Logs

from error_analyzer import LogAnalyzer

analyzer = LogAnalyzer(api_key="your_key")

# Analyze from string
result = analyzer.analyze(log_content)

# Analyze from file
result = analyzer.analyze_file("/path/to/error.log")

# Get structured output
print(result.errors)
print(result.patterns)
print(result.suggestions)

Real-time Monitoring

from error_analyzer import LogMonitor

monitor = LogMonitor(
    log_path="/var/log/myapp/error.log",
    alert_callback=send_slack_alert
)

monitor.start()

FAQ

Q: Does this work offline?

A: Basic log parsing works offline. AI features require an API key (Claude or OpenAI).

Q: How accurate are the AI explanations?

A: Our tests show 95%+ accuracy for common error types. You can provide feedback to improve results.

Q: Can I use my own AI model?

A: Yes! Supports local models via Ollama or any OpenAI-compatible API.

Q: What about sensitive data in logs?

A: All processing happens locally. Logs are never stored on external servers.

Q: How is this different from Sentry/Datadog?

A: This focuses on AI-powered explanations rather than just error tracking. Lighter weight and more affordable for indie developers.

Support

Roadmap

  • [ ] Support for more languages (Rust, Ruby, Java)
  • [ ] Integration with GitHub Issues
  • [ ] Slack/Discord alerts
  • [ ] Performance metrics correlation
  • [ ] Custom AI model training

License

MIT License - Use freely for personal and commercial projects.


Made with ❤️ by janseling for the OpenClaw community

版本历史

共 1 个版本

  • v1.2.0 当前
    2026-05-12 05:24 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

it-ops-security

Free Ride - Unlimited free AI

shaivpidadi
管理OpenClaw的OpenRouter免费AI模型,自动按质量排名模型,配置速率限制备用方案,并更新opencla...
★ 472 📥 78,738
it-ops-security

MoltGuard - Security & Antivirus & Guardrails

thomaslwang
MoltGuard — OpenClaw 安全守卫,由 OpenGuardrails 提供。安装后可防止您和您的用户受到提示注入、数据泄露及恶意行为的侵害。
★ 116 📥 31,039
it-ops-security

1password

steipete
设置和使用 1Password CLI (op)。适用于:安装 CLI、启用桌面应用集成、登录(单/多账户)、通过 op 读取/注入/运行密钥。
★ 53 📥 31,952