- Home
- Skills
- Jeremylongshore
- Claude Code Plugins Plus Skills
- Logging Api Requests
logging-api-requests_skill
- Python
1.4k
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill jeremylongshore/claude-code-plugins-plus-skills --skill logging-api-requests- SKILL.md2.4 KB
Overview
This skill monitors and logs API requests and responses, enriching each interaction with correlation IDs, performance metrics, and security audit trails. It helps teams capture structured telemetry for debugging, compliance, and performance analysis. Use it to add consistent, searchable logs across services and frameworks.
How this skill works
The skill inspects incoming and outgoing HTTP traffic and injects or propagates correlation IDs to tie distributed calls together. It measures latency, payload sizes, status codes, and error stacks, and records security-relevant events like authentication attempts and permission checks. Logs are emitted in structured formats and can be routed to files, databases, or observability platforms for analysis and alerting.
When to use it
- Auditing API requests and responses for compliance or post-incident review
- Adding consistent tracing across microservices to correlate distributed transactions
- Measuring endpoint performance and identifying latency regressions
- Capturing security-relevant events for audit trails and forensic analysis
- Generating searchable, structured logs for debugging and monitoring
Best practices
- Propagate a single correlation ID per request and include it in logs, headers, and error reports
- Log structured JSON with consistent fields: timestamp, service, correlation_id, user_id, path, method, status, duration
- Record both high-level metrics (latency, error rate) and detailed traces for slow or failed requests
- Avoid logging sensitive data; mask or omit credentials and PII before persisting
- Integrate with existing observability tools (e.g., ELK, Prometheus, Jaeger) and export metrics and traces
Example use cases
- Add middleware to a FastAPI or Express app that generates correlation IDs and logs each request/response pair
- Instrument endpoints to capture response times and send aggregated metrics to a monitoring service
- Create an audit log stream for authentication and authorization events to meet compliance requirements
- Attach request context to error reports so support teams can reproduce and trace failures
- Build integration tests that assert logs include required fields and that correlation IDs persist across service calls
FAQ
No. The skill recommends masking or omitting sensitive fields and provides hooks to sanitize payloads before logging.
Can correlation IDs be propagated across services?
Yes. The middleware injects and forwards correlation IDs via HTTP headers so downstream services can join the same trace.