Structured Logging Audit Gate

Sistemde optimum maliyetli yapısal loglama, asenkron exception takibi ve temiz denetim izi (Audit Trail) kurallarını zorunlu tutan kapı.

GktuOktay f941167 1.0 KB Updated

File contents

Structured Logging & Audit Gate

CRITICAL RULE: When writing backend logic, controllers, or database layers, you MUST enforce the following logging and auditing principles:

  1. No Full Req/Res Payload Logging: NEVER log full HTTP request or response bodies for successful (200 OK) requests due to storage and PII/GDPR costs. Log only Metadata (Method, Path, StatusCode, Duration, UserID). Exception logs can contain payloads if necessary.
  2. Triad Logging Separation:
    • Diagnostic/Exception Logs: Must be logged asynchronously. Do not write these to the main OLTP database tables fighting for IOPS.
    • Security/Audit Logs: Must be immutable.
    • User Activity Logs: Do NOT write hardcoded localized strings (e.g., "Sipariş güncellendi"). Save an ActionType (e.g., "ORDER_UPDATED") and JSON Metadata. Let the frontend translate it.

GktuOktay/autonomous-agency/tree/main/.claude/skills/structured-logging-audit-gate commit f941167816

Frequently asked questions

npx skillmds@latest add gktuoktay/structured-logging-audit-gate