Collection of log/slog related projects.
Do you have something to add? Please read the contributing guide and open a pull request.
General purpose handlers and integrations.
- slog-exp: Individual log files foe levels, Wrapping ReplaceAttr, displaying goroutine id, etc.
- slog-multi: Chaining handlers (pipe, router, fanout, etc).
- slog-sampling: Drop repetitive log entries.
- slog-shim: Backward compatible slog support for Go <1.21.
- slogbuffer: Buffer log records until real handler is defined.
- slogscope: Package based log levels for more fine grained control over logging behavior in large project.
- sloggen: Generate various helpers.
- sloglint: Ensure consistent code style.
Record and output formatters.
- console-slog: Handler that prints colorized logs, similar to zerolog's console writer output without sacrificing performances.
- devslog: Format logs for development.
- golog: Development, discard and production handlers with sensible formatting.
- slog-formatter: Common formatters for slog + helpers for building your own.
- slogor: A colorful slog handler.
- slogpfx: Easily prefix your log messages with attributes from the log record.
- tint: Handler that writes tinted logs.
- zlog: Handler that writes beautiful, human readable logs.
- zlog: Human-friendly output like zap development, json structured logging with more features for slog.
Handlers enriching log records.
- masq: Redact sensitive data in logs.
- otelslog: Handler attaching OpenTelemetry trace and resource details to logs.
- slog-aws-lambda: Handler for AWS Lambda Functions.
- slog-context: Attach arbitrary key-value pairs to log records through context.
- slog-otel: Correlation between slog log records and Open-Telemetry traces.
Handlers forwarding logs.
- slog-clickhouse: Handler forwarding logs to ClickHouse.
- slog-datadog: Handler forwarding logs to Datadog.
- slogdriver: Handler forwarding logs to Stackdriver / GCP Cloud Logging.
- slog-fluentd: Handler forwarding logs to FluentD.
- slog-graylog: Handler forwarding logs to Graylog.
- slog-kafka: Handler forwarding logs to Kafka.
- slog-logstash: Handler forwarding logs to Logstash.
- slog-loki: Handler forwarding logs to Loki.
- slog-mattermost: Handler forwarding logs to Mattermost.
- slog-microsoft-teams: Handler forwarding logs to Microsoft Teams.
- slog-parquet: Handler forwarding logs to an object store in parquet format.
- slog-pushover: Handler forwarding logs to Pushover.
- slog-rollbar: Handler forwarding logs to Rollbar.
- slog-sentry: Handler forwarding logs to Sentry.
- slog-slack: Handler forwarding logs to Slack.
- slog-syslog: Handler forwarding logs to Syslog.
- slog-telegram: Handler forwarding logs to Telegram.
- slog-webhook: Handler forwarding logs to a Webhook.
Adapters for other logging libraries.
- go-hclog-slog: Handler adapter for hclog.
- gslog: Handler adapter for Google Cloud Logging.
- slog-logrus: Handler adapter for logrus.
- slog-zap: Handler adapter for zap.
- slog-zerolog: Handler adapter for zerolog.
- zaphandler: Handler adapter for Zap.
log/slog
integrations into third-party components.
- ginslog: A fully featured Gin middleware.
- shclog: Hclog adapter for slog.
- slog-chi: Chi middleware.
- slog-echo: Echo middleware.
- slog-fiber: Fiber middleware.
- slog-gin: Gin middleware.
Testing utilities for log/slog
.
- slogassert: slog handler for testing slog code logs expected results.
- slogt: Bridge between Go
testing.T
andlog/slog
.
Other resources about log/slog
.
Blog posts about log/slog
.
Resources documenting the creation of log/slog
.