Request-body logging can send passwords, tokens, and personal data to external log systems
Source references: 4The main example explicitly enables `WithRequestBody: true`, while the configuration reference only states that bodies are size-capped. The documented hiding mechanism covers headers and does not establish that arbitrary sensitive body fields are scrubbed. The Skill also recommends routing logs to several cloud and notification backends.
If API requests contain login credentials, access tokens, payment information, health data, or other personal information, those values may enter Loki, Sentry, Datadog, Slack, or a webhook and become subject to those systems' retention, access, and cross-border transfer policies.
The example actively enables request-body logging. The reference only documents a size cap, while the stated hiding controls cover headers, not arbitrary body fields. If a body contains passwords, tokens, or personal data and logs use Loki, Datadog, Sentry, or another sink, that data could leave the process. Users can require body logging to remain off by default, ask for documented body-level redaction, and restrict approved sinks.
```go// Gin with filters — skip health checksrouter.Use(sloggin.NewWithConfig(logger, sloggin.Config{ DefaultLevel: slog.LevelInfo, ClientErrorLevel: slog.LevelWarn, ServerErrorLevel: slog.LevelError, WithRequestBody: true, Filters: []sloggin.Filter{ sloggin.IgnorePath("/health", "/metrics"), },}))```Show 3 other places
| `WithRequestID` | `bool` | `false` | Include request ID || `WithRequestBody` | `bool` | `false` | Include request body (capped) || `WithResponseBody` | `bool` | `false` | Include response body (capped) || `WithRequestHeader` | `bool` | `false` | Include request headers || `WithResponseHeader` | `bool` | `false` | Include response headers || `WithSpanID` | `bool` | `false` | Include OpenTelemetry span ID |**Global configuration variables** (set before creating middleware):- `RequestBodyMaxSize` / `ResponseBodyMaxSize` — default 64KB each- `HiddenRequestHeaders` / `HiddenResponseHeaders` — headers to redact- `TraceIDKey` / `SpanIDKey` — context key names for OpenTelemetry| Category | Packages || ------------ | ---------------------------------------------------------- || Cloud | `slog-datadog`, `slog-sentry`, `slog-loki`, `slog-graylog` || Messaging | `slog-kafka`, `slog-fluentd`, `slog-logstash`, `slog-nats` || Notification | `slog-slack`, `slog-telegram`, `slog-webhook` || Storage | `slog-parquet` || Bridges | `slog-zap`, `slog-zerolog`, `slog-logrus` |