dykyi-roman/awesome-claude-code/create-structured-logger
Trust tier 2
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Generates Structured Logger for PHP 8.4. Creates PSR-3 structured logging setup with Monolog processors, correlation ID propagation, and context middleware. Includes unit tests.
Install
npx vskill@latest install dykyi-roman/awesome-claude-code/create-structured-loggerSKILL.md
Structured Logger Generator
Creates structured logging infrastructure for observability and request tracing.
When to Use
| Scenario | Example | |
|---|---|---|
| Distributed tracing | Correlate logs across microservices | |
| Request debugging | Track full request lifecycle | |
| Audit logging | Structured records with context | |
| Error investigation | Rich context in error logs |
Component Characteristics
CorrelationId
- Value Object wrapping UUIDv4
- Immutable, self-validating
- Propagated via
X-Request-IDheader
CorrelationIdProcessor
- Monolog processor adding
correlation_idto every record - Reads from CorrelationIdHolder thread-local storage
- Zero-config: auto-enriches all log entries
RequestContextProcessor
- Monolog processor adding request metadata
- Captures method, URI, IP, user-agent
- Enables filtering logs by request attributes
CorrelationIdMiddleware
- PSR-15 middleware extracting or generating X-Request-ID
- Stores in CorrelationIdHolder for downstream use
- Adds correlation ID to response headers
CorrelationIdHolder
- Static thread-local storage for correlation ID
- Set once per request, available globally
- Reset after request completes
Generation Process
Step 1: Generate Core Components
Path: src/Infrastructure/Logging/
CorrelationId.php— Value Object with UUID validationCorrelationIdHolder.php— Thread-local correlation ID storage
Step 2: Generate Monolog Processors
Path: src/Infrastructure/Logging/Processor/
CorrelationIdProcessor.php— Adds correlation_id to log recordsRequestContextProcessor.php— Adds request context to log records
Step 3: Generate Middleware
Path: src/Infrastructure/Logging/
CorrelationIdMiddleware.php— PSR-15 middleware for correlation ID
Step 4: Generate Tests
CorrelationIdTest.php— Value Object testsCorrelationIdProcessorTest.php— Processor enrichment testsCorrelationIdMiddlewareTest.php— Middleware behavior tests
File Placement
| Component | Path | |
|---|---|---|
| Core Classes | src/Infrastructure/Logging/ | |
| Processors | src/Infrastructure/Logging/Processor/ | |
| Unit Tests | tests/Unit/Infrastructure/Logging/ |
Naming Conventions
| Component | Pattern | Example | |
|---|---|---|---|
| Value Object | CorrelationId | CorrelationId | |
| Holder | CorrelationIdHolder | CorrelationIdHolder | |
| Processor | {Context}Processor | CorrelationIdProcessor | |
| Middleware | CorrelationIdMiddleware | CorrelationIdMiddleware | |
| Test | {ClassName}Test | CorrelationIdTest |
Quick Template Reference
CorrelationId
CorrelationIdProcessor
CorrelationIdMiddleware
Usage Example
Log Flow
Anti-patterns to Avoid
| Anti-pattern | Problem | Solution | |
|---|---|---|---|
| Manual correlation IDs | Inconsistent, easy to forget | Auto-enrich via processor | |
| Unstructured logs | Cannot query or filter | Use structured JSON format | |
| No request context | Cannot trace request flow | Add request processor | |
| Global mutable logger | Thread safety issues | Use holder with request scope | |
| Missing response header | Client cannot correlate | Return X-Request-ID in response | |
| No holder cleanup | Memory leak between requests | Reset holder after request |
References
For complete PHP templates and examples, see:
references/templates.md— CorrelationId, Processors, Middleware, Holder templatesreferences/examples.md— Service integration examples and tests
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/create-structured-logger/SKILL.md
Popularity
- Repository stars
- 96
- Repository forks
- 25
- 7-day trend score
- 23
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 18 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/dykyi-roman/awesome-claude-code/create-structured-logger)