$ recombobulate _
home / tips / ask-claude-to-set-up-structured-json-logging
ask-claude-to-set-up-structured-json-logging

Plain text logs are hard to search and impossible to parse in a log aggregator. Structured JSON logs give you queryable fields and context on every line — and Claude can set the whole thing up.

Set up structured JSON logging in my Express app using Pino.
Add request middleware that includes: request_id, method, path, status_code, 
response_time_ms, and user_id (if the request is authenticated).

Claude will install the right library, configure log levels per environment (debug locally, info in production), and add the middleware. For Laravel:

Configure Laravel's logging stack to output JSON in production.
Add a custom processor that includes the authenticated user ID, 
request ID (from X-Request-Id header), and app version in every log entry.

You can also route logs to external services:

Add a Laravel logging channel called 'slack_errors' that sends 
ERROR and CRITICAL level logs to Slack using the LOG_SLACK_WEBHOOK_URL env var.
Configure the 'stack' channel to use both 'daily' and 'slack_errors'.

Claude understands log channel stacking, tap processors, and formatter configuration — the parts where the docs always send you in circles.

Structured logs are searchable, alertable, and production-ready — set them up once with Claude.

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
0
Detect and Fix Memory Leaks in Your Node.js Application with Claude

Hand Claude your heap snapshots or server code and ask it to trace memory leaks — it spots missing event listener cleanup, unbounded caches, and stream lifecycle bugs that are easy to miss in code review.

bagwaa @bagwaa · 2 hours ago
0
Audit Your UI Components for Accessibility Issues with Claude

Ask Claude to audit your UI components for WCAG accessibility issues — it catches semantic problems, missing ARIA attributes, and keyboard navigation gaps that automated tools miss.

bagwaa @bagwaa · 2 hours ago
0
Debug API and MCP Issues with --debug

The --debug flag enables verbose logging for Claude Code, and an optional category filter like "api,mcp" lets you narrow output to exactly the subsystem you need to investigate.

bagwaa @bagwaa · 5 hours ago