
Log Analysis
- 563 installs
- 305 repo stars
- Updated March 4, 2026
- aj-geddes/useful-ai-prompts
log-analysis is a Debugging skill that parses application and system logs to surface errors, performance patterns, and root causes for developers troubleshooting production incidents.
About
log-analysis is a Debugging skill from aj-geddes/useful-ai-prompts that analyzes application and system logs to identify errors, recurring patterns, and root causes using structured logging and aggregation practices. Developers reach for log-analysis when troubleshooting failures, investigating performance regressions, reviewing security incidents, auditing user actions, or monitoring application health. The skill guides effective log parsing so agents quickly narrow noisy stack traces and timestamps into actionable reports rather than raw dump review. log-analysis fits operate-stage workflows where staging or production telemetry must be interpreted under time pressure. It complements monitoring stacks by focusing on interpretive analysis—correlating events, highlighting anomalies, and explaining likely root causes from unstructured or semi-structured log streams inside Claude or Cursor debugging sessions.
- Identifies errors, patterns, and root causes from logs
- Promotes structured logging with JSON formats for machine readability
- Supports troubleshooting, performance investigation, security analysis, and health monitoring
- Works with log aggregation tools and Elasticsearch-friendly schemas
- Provides concrete before-and-after examples of good vs bad log formats
Log Analysis by the numbers
- 563 all-time installs (skills.sh)
- Ranked #76 of 596 Debugging skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill log-analysisAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 563 |
|---|---|
| repo stars | ★ 305 |
| Last updated | March 4, 2026 |
| Repository | aj-geddes/useful-ai-prompts ↗ |
How do you find root cause from application logs?
Quickly turn raw application and system logs into actionable error reports, performance insights, and root cause explanations.
Who is it for?
Developers debugging production or staging incidents who have raw application or system logs and need structured root cause analysis fast.
Skip if: Teams wanting automated log shipping pipeline setup, APM dashboard configuration, or proactive alerting rule authoring without existing log files.
When should I use this skill?
The user pastes or references application logs, reports errors in production, or asks for performance investigation and security incident log review.
What you get
Actionable error reports, performance insight summaries, and root cause explanations derived from parsed log data.
- error analysis report
- root cause summary
Files
Log Analysis
Table of Contents
Overview
Logs are critical for debugging and monitoring. Effective log analysis quickly identifies issues and enables root cause analysis.
When to Use
- Troubleshooting errors
- Performance investigation
- Security incident analysis
- Auditing user actions
- Monitoring application health
Quick Start
Minimal working example:
// Good: Structured logs (machine-readable)
logger.info({
level: 'INFO',
timestamp: '2024-01-15T10:30:00Z',
service: 'auth-service',
user_id: '12345',
action: 'user_login',
status: 'success',
duration_ms: 150,
ip_address: '192.168.1.1'
});
// Bad: Unstructured logs (hard to parse)
console.log('User 12345 logged in successfully in 150ms from 192.168.1.1');
// JSON Format (Elasticsearch friendly)
{
"@timestamp": "2024-01-15T10:30:00Z",
"level": "ERROR",
"service": "api-gateway",
"trace_id": "abc123",
"message": "Database connection failed",
"error": {
"type": "ConnectionError",
"code": "ECONNREFUSED"
// ... (see reference guides for full implementation)Reference Guides
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| Structured Logging | Structured Logging |
| Log Levels & Patterns | Log Levels & Patterns |
| Log Analysis Tools | Log Analysis Tools |
| Common Log Analysis Queries | Common Log Analysis Queries |
Best Practices
✅ DO
- Follow established patterns and conventions
- Write clean, maintainable code
- Add appropriate documentation
- Test thoroughly before deploying
❌ DON'T
- Skip testing or validation
- Ignore error handling
- Hard-code configuration values
Common Log Analysis Queries
Common Log Analysis Queries
Find errors in past hour:
timestamp: last_1h AND level: ERROR
Track user activity:
user_id: 12345 AND action: *
Find slow requests:
duration_ms: >1000 AND level: INFO
Analyze error rate by service:
level: ERROR | stats count by service
Find failed database operations:
error.type: "DatabaseError" | stats count
Trace request flow:
trace_id: "abc123" | sort by timestamp
---
Checklist:
[ ] Structured logging implemented
[ ] All errors logged with context
[ ] Request IDs/trace IDs used
[ ] Sensitive data not logged (passwords, tokens)
[ ] Log levels used appropriately
[ ] Log retention policy set
[ ] Log sampling for high-volume events
[ ] Alerts configured for errors
[ ] Dashboards created
[ ] Regular log review scheduled
[ ] Log analysis tools accessible
[ ] Team trained on querying logsLog Analysis Tools
Log Analysis Tools
Log Aggregation:
ELK Stack (Elasticsearch, Logstash, Kibana):
- Logstash: Parse and process logs
- Elasticsearch: Search and analyze
- Kibana: Visualization and dashboards
- Use: Large scale, complex queries
Splunk:
- Comprehensive log management
- Real-time search and analysis
- Dashboards and alerts
- Use: Enterprise (expensive)
CloudWatch (AWS):
- Integrated with AWS services
- Log Insights for querying
- Dashboards
- Use: AWS-based systems
Datadog:
- Application performance monitoring
- Log management
- Real-time alerts
- Use: SaaS monitoring
---
Log Analysis Techniques:
Grep/Awk: grep "ERROR" app.log
awk '{print $1, $4}' app.log
Filtering: Filter by timestamp
Filter by service
Filter by error type
Filter by user
Searching: Search for error patterns
Search for user actions
Search trace IDs
Search IP addresses
Aggregation: Count occurrences
Group by error type
Calculate duration percentiles
Rate of errors over timeLog Levels & Patterns
Log Levels & Patterns
Log Levels:
DEBUG: Detailed diagnostic info
- Variable values
- Function entry/exit
- Intermediate calculations
- Use: Development only
INFO: General informational messages
- Startup/shutdown
- User actions
- Configuration changes
- Use: Production (normal operations)
WARN: Warning messages (potential issues)
- Deprecated API usage
- Performance degradation
- Resource limits approaching
- Use: Production (investigate soon)
ERROR: Error conditions
- Failed operations
- Exceptions
- Failed requests
- Use: Production (action required)
FATAL/CRITICAL: System unusable
- Critical failures
- Out of memory
- Data corruption
- Use: Production (immediate action)
---
Log Patterns:
Request Logging:
- Request ID (trace_id)
- Method + Path
- Status code
- Duration
- Request size / response size
Error Logging:
- Error type/code
- Error message
- Stack trace
- Context (user_id, session_id)
- Timestamp
Business Events:
- Event type
- User involved
- Impact/importance
- Timestamp
- Relevant contextStructured Logging
Structured Logging
// Good: Structured logs (machine-readable)
logger.info({
level: 'INFO',
timestamp: '2024-01-15T10:30:00Z',
service: 'auth-service',
user_id: '12345',
action: 'user_login',
status: 'success',
duration_ms: 150,
ip_address: '192.168.1.1'
});
// Bad: Unstructured logs (hard to parse)
console.log('User 12345 logged in successfully in 150ms from 192.168.1.1');
// JSON Format (Elasticsearch friendly)
{
"@timestamp": "2024-01-15T10:30:00Z",
"level": "ERROR",
"service": "api-gateway",
"trace_id": "abc123",
"message": "Database connection failed",
"error": {
"type": "ConnectionError",
"code": "ECONNREFUSED"
},
"context": {
"database": "users",
"operation": "SELECT"
}
}#!/bin/bash
# security-checklist.sh - Generate a security review checklist
# Usage: ./security-checklist.sh [--output checklist.md]
set -euo pipefail
OUTPUT="${{1:-/dev/stdout}}"
cat > "$OUTPUT" << 'CHECKLIST'
# Security Review Checklist
## Authentication & Authorization
- [ ] All endpoints require authentication
- [ ] Role-based access control implemented
- [ ] Session management is secure
## Input Validation
- [ ] All user inputs are validated
- [ ] SQL injection prevention
- [ ] XSS prevention
## Data Protection
- [ ] Sensitive data encrypted at rest
- [ ] Sensitive data encrypted in transit
- [ ] PII handling compliant
## TODO: Add domain-specific security checks
CHECKLIST
echo "Checklist generated: $OUTPUT" >&2
Related skills
How it compares
Pick log-analysis over ctx-doctor when the input is application runtime logs, not Context Mode plugin health diagnostics.
FAQ
What log types does log-analysis handle?
log-analysis handles application and system logs, using structured logging and aggregation techniques to identify errors, performance issues, security events, and user action audit trails.
When should log-analysis be invoked?
log-analysis should be invoked during troubleshooting errors, performance investigations, security incident reviews, health monitoring, or whenever raw logs need root cause interpretation.
What does log-analysis output provide?
log-analysis outputs actionable error reports, highlighted patterns, and root cause explanations distilled from noisy log streams, enabling faster fixes during operate-stage incidents.