Skip to content

claude-commands/command-logs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

command-logs

A Claude Code slash command for analyzing log files for issues and patterns.

Installation

# Clone to your preferred location
git clone git@github.com:claude-commands/command-logs.git <clone-path>/command-logs

# Symlink (use full path to cloned repo)
ln -s <clone-path>/command-logs/logs.md ~/.claude/commands/logs.md

Usage

/logs                    # Find and summarize all logs
/logs app.log            # Analyze specific log file
/logs --errors           # Show only errors and warnings
/logs --tail             # Watch logs in real-time
/logs docker             # Analyze Docker container logs

What it does

  1. Finds log files in the project
  2. Detects log format (JSON, Apache, Syslog, etc.)
  3. Parses and categorizes entries
  4. Identifies errors and patterns
  5. Generates analysis with recommendations

Output Format

# Log Analysis: app.log

## Summary
| Level | Count |
| ----- | ----- |
| ERROR | 127 |
| WARN | 892 |
| INFO | 42,156 |

## Top Errors
### 1. Database Connection Failed (45 occurrences)
Likely cause: Database server was down
Suggested fix: Add connection retry logic

Log Format Support

Format Example
JSON Lines {"level":"error","msg":"..."}
Apache/Nginx 192.168.1.1 - - [15/Jan/2025:10:30:00]
Syslog Jan 15 10:30:00 host app[123]:
Application 2025-01-15 10:30:00 ERROR ...

Filter Options

Option Description
--errors Show only errors and warnings
--tail Follow logs in real-time
--since 1h Filter by time
--json Parse as JSON logs

Requirements

  • Log files or Docker containers
  • Claude Code with Opus 4.5 model access

Updates

cd <clone-path>/command-logs && git pull

About

Claude Code command: Analyze log files for issues and patterns

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •