Log Analysis

Log Analysis

Teaches a coding agent to analyse application and system logs to find errors, patterns and root causes using structured logging and aggregation tools.

Skill files6 files

references/

scripts/

SKILL.md89 lines
1
---
2
name: log-analysis
3
description: >
4
Analyze application and system logs to identify errors, patterns, and root
5
causes. Use log aggregation tools and structured logging for effective
6
debugging.
7
---
8
9
# Log Analysis
10
11
## Table of Contents
12
13
- [Overview](#overview)
14
- [When to Use](#when-to-use)
15
- [Quick Start](#quick-start)
16
- [Reference Guides](#reference-guides)
17
- [Best Practices](#best-practices)
18
19
## Overview
20
21
Logs are critical for debugging and monitoring. Effective log analysis quickly identifies issues and enables root cause analysis.
22
23
## When to Use
24
25
- Troubleshooting errors
26
- Performance investigation
27
- Security incident analysis
28
- Auditing user actions
29
- Monitoring application health
30
31
## Quick Start
32
33
Minimal working example:
34
35
```javascript
36
// Good: Structured logs (machine-readable)
37
logger.info({
38
level: 'INFO',
39
timestamp: '2024-01-15T10:30:00Z',
40
service: 'auth-service',
41
user_id: '12345',
42
action: 'user_login',
43
status: 'success',
44
duration_ms: 150,
45
ip_address: '192.168.1.1'
46
});
47
48
// Bad: Unstructured logs (hard to parse)
49
console.log('User 12345 logged in successfully in 150ms from 192.168.1.1');
50
51
// JSON Format (Elasticsearch friendly)
52
{
53
"@timestamp": "2024-01-15T10:30:00Z",
54
"level": "ERROR",
55
"service": "api-gateway",
56
"trace_id": "abc123",
57
"message": "Database connection failed",
58
"error": {
59
"type": "ConnectionError",
60
"code": "ECONNREFUSED"
61
// ... (see reference guides for full implementation)
62
```
63
64
## Reference Guides
65
66
Detailed implementations in the `references/` directory:
67
68
| Guide | Contents |
69
|---|---|
70
| [Structured Logging](references/structured-logging.md) | Structured Logging |
71
| [Log Levels & Patterns](references/log-levels-patterns.md) | Log Levels & Patterns |
72
| [Log Analysis Tools](references/log-analysis-tools.md) | Log Analysis Tools |
73
| [Common Log Analysis Queries](references/common-log-analysis-queries.md) | Common Log Analysis Queries |
74
75
## Best Practices
76
77
### ✅ DO
78
79
- Follow established patterns and conventions
80
- Write clean, maintainable code
81
- Add appropriate documentation
82
- Test thoroughly before deploying
83
84
### ❌ DON'T
85
86
- Skip testing or validation
87
- Ignore error handling
88
- Hard-code configuration values
89

© AJ Geddes · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…