---
name: "zap-blazing-fast-go-logger"
description: "Log structured events with zero heap allocations and extreme throughput using Uber Zap."
metadata:
  author: "Uber"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "configure uber zap logger"
  - "zap zero allocation logging"
  - "log rotation lumberjack zap"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# Uber Zap Blazing-Fast Structured Logging in Go

Configures Uber Zap: zap.Logger (strongly-typed zero-allocation) vs zap.SugaredLogger, custom encoder configs, sampling policies, log rotation integration with lumberjack, and JSON production formatting.

## When to Invoke
Invoke this skill whenever you need to:
- configure uber zap logger
- zap zero allocation logging
- log rotation lumberjack zap

## Execution SOP & Rules
1. Create logger: logger, _ := zap.NewProduction(zap.AddCaller(), zap.AddStacktrace(zap.ErrorLevel)).
2. Log with typed fields: logger.Info('user logged in', zap.String('userId', id), zap.Int('attempts', count)).
3. Use sugared logger for looser formatting: sugar := logger.Sugar(); sugar.Infow('event', 'key', 'val').
4. Always call defer logger.Sync() in main() to flush buffered log entries before process exit.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
