api-logging-guidelines

Define structured API route logging levels and contextual data for REST and GraphQL.

1.4k|162|Updated Sep 5, 2025
One-click install
npx skills add https://github.com/inkeep/agents --skill api-logging-guidelines
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-logging-guidelines
Source: https://github.com/inkeep/agents/tree/main/.agents/skills/api-logging-guidelines
Command: npx skills add https://github.com/inkeep/agents --skill api-logging-guidelines

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides clear, actionable guidance for implementing and auditing API route logging to maintain clean, useful logs and improve troubleshooting.

Core Features & Use Cases

  • Logging level recommendations: Defines when to use ERROR, WARN, INFO, and DEBUG for API events.
  • Contextual logging guidance: Examples of what context to include (request IDs, user IDs, endpoints) and what to avoid logging.
  • Use Case: Apply these guidelines to route handlers, middleware, and error handlers to reduce noise and improve observability.

Quick Start

Follow the guidelines to review or implement logging in a sample API route and adjust log statements accordingly.

Frequently Asked Questions about api-logging-guidelines

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What should I log in API route handlers to improve observability?

API route logging should include contextual data like request IDs, user IDs, and endpoints. This framework guides log content and levels to improve troubleshooting while reducing noise across REST and GraphQL APIs.

How do I choose the right log levels for API events?

Choosing the right log levels for API events requires defining when to use ERROR, WARN, INFO, and DEBUG. This framework provides structured recommendations to enforce appropriate log levels across middleware and error handling workflows.

How do I prevent logging sensitive information in API middleware?

Preventing sensitive information in API middleware logging requires contextual data safeguards. This framework enforces appropriate log levels and provides guidance on what context to avoid logging to maintain clean API logs.

What is the best way to structure REST and GraphQL API logging?

The best way to structure REST and GraphQL API logging is applying a consistent framework for log levels and context. This approach reduces noisy logs and improves troubleshooting across middleware and route handlers.

How do I audit existing API logging for noise and usefulness?

Auditing API logging for noise involves reviewing route handlers against structured level recommendations. This framework provides actionable guidance to implement clean logs, enforce contextual data, and improve troubleshooting.