Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

logging-api-requestslogging API requests 搜索

Agent Skill

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

总安装

588

周安装

25

GitHub Stars

2,102

下载量

206
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:logging-api-requests(logging API requests 搜索)
来源仓库:https://github.com/jeremylongshore/claude-code-plugins-plus-skills
仓库路径:skills/logging-api-requests
安装命令:
npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill logging-api-requests
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill logging-api-requests

简介

用于辅助 API 设计、接口文档和请求响应结构梳理。

  • 适合生成 OpenAPI 草稿、检查字段命名和错误码。
  • 使用时需确认真实业务语义和鉴权方式,避免凭空补字段。
  • 安装前建议确认权限范围、维护状态及是否触发联网或文件读写。
  • 适用于 Codex、Claude、Cursor 和 Gemini CLI 等宿主环境。

SKILL.md

Logging API Requests

Overview

Implement structured API request logging with correlation IDs, performance timing, security audit trails, and PII redaction. Capture request/response metadata in JSON format suitable for aggregation in ELK Stack, Loki, or CloudWatch Logs, enabling debugging, performance analysis, and compliance auditing across distributed services.

Prerequisites

  • Structured logging library: Pino or Winston (Node.js), structlog (Python), Logback with JSON encoder (Java)
  • Log aggregation system: ELK Stack (Elasticsearch, Logstash, Kibana), Grafana Loki, or CloudWatch Logs
  • Correlation ID propagation mechanism (middleware-injected or from incoming X-Request-ID header)
  • PII data classification for the API domain (which fields contain personal data requiring redaction)
  • Log retention and rotation policy defined per compliance requirements

Instructions

  1. Examine existing logging configuration using Grep and Read to identify current log format, output destinations, and any structured logging already in place.
  2. Implement request logging middleware that captures: timestamp (ISO 8601), correlation ID, HTTP method, URL path (without query string PII), status code, response time (ms), request size, response size, and client IP.
  3. Generate a unique correlation ID (X-Request-ID) for each request if not provided by the caller, and propagate it to all downstream service calls and log entries within the request scope.
  4. Add PII redaction rules that mask sensitive fields (passwords, tokens, SSNs, email addresses) in logged request/response bodies using configurable field-path patterns.
  5. Implement log levels per context: info for successful requests, warn for 4xx client errors, error for 5xx server errors with stack traces, and debug for request/response bodies (development only).
  6. Configure response body logging for error responses only (4xx/5xx), capturing the error payload for debugging while skipping successful response bodies to reduce log volume.
  7. Add security audit logging for sensitive operations: authentication attempts, permission changes, data exports, and admin actions, tagged with audit: true for separate indexing.
  8. Set up log rotation and retention policies: 30 days for application logs, 90 days for audit logs, with automatic compression of logs older than 7 days.
  9. Write tests verifying that PII redaction works correctly, correlation IDs propagate through nested calls, and log output matches expected JSON structure.

See ${CLAUDE_SKILL_DIR}/references/implementation.md for the full implementation guide.

Output

  • ${CLAUDE_SKILL_DIR}/src/middleware/request-logger.js - Structured request/response logging middleware
  • ${CLAUDE_SKILL_DIR}/src/middleware/correlation-id.js - Correlation ID generation and propagation
  • ${CLAUDE_SKILL_DIR}/src/utils/pii-redactor.js - Field-level PII redaction with configurable patterns
  • ${CLAUDE_SKILL_DIR}/src/utils/audit-logger.js - Security audit event logger for sensitive operations
  • ${CLAUDE_SKILL_DIR}/src/config/logging.js - Log level, format, and output destination configuration
  • ${CLAUDE_SKILL_DIR}/tests/logging/ - Logging middleware tests including PII redaction verification

Error Handling

ErrorCauseSolution
Log volume overwhelming storageHigh-traffic endpoint logging full request/response bodiesLog bodies only for errors; sample successful request bodies at configurable rate (1%)
PII leak in logsNew field added to API response containing personal data not covered by redaction rulesMaintain allowlist of loggable fields rather than blocklist; audit log output regularly
Correlation ID missingUpstream service does not propagate X-Request-ID headerGenerate new correlation ID when header is absent; log warning about missing upstream propagation
Log parsing failureLog message contains unescaped characters breaking JSON structureUse structured logging library that handles serialization; never concatenate user input into log strings
Audit log gapAsync logging dropped events during high-load periodUse synchronous logging for audit events; implement write-ahead buffer for audit trail completeness

Refer to ${CLAUDE_SKILL_DIR}/references/errors.md for comprehensive error patterns.

Examples

Structured JSON log entry: {"timestamp":"2026-03-10T14:30:00Z","correlationId":"abc-123","method":"POST","path":"/api/users","status":201,"durationMs":45,"userId":"usr_456","audit":false} -- every field queryable in log aggregation.

Distributed tracing correlation: Propagate X-Request-ID from API gateway through 3 microservices, enabling a single Kibana query to show the complete request lifecycle across all services.

Compliance audit trail: Tag all data modification operations (POST, PUT, DELETE) with audit: true, capturing the authenticated user, modified resource ID, and change summary for SOC 2 compliance evidence.

See ${CLAUDE_SKILL_DIR}/references/examples.md for additional examples.

Resources

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.98%
按下载量换算72

Claude

30%
按下载量换算62

Cursor

19.89%
按下载量换算41

Gemini CLI

9.46%
按下载量换算19

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills