Skip to content

go-slog/awesome-slog

Repository files navigation

Awesome slog

Collection of log/slog related projects.

Do you have something to add? Please read the contributing guide and open a pull request.

Contents

General

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.

⬆ back to top

Formatting

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.

⬆ back to top

Enrichment

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.

⬆ back to top

Log forwarding

Handlers forwarding logs.

⬆ back to top

Adapters

Adapters for other logging libraries.

⬆ back to top

Integrations

log/slog integrations into third-party components.

⬆ back to top

Testing

Testing utilities for log/slog.

  • slogassert: slog handler for testing slog code logs expected results.
  • slogt: Bridge between Go testing.T and log/slog.

⬆ back to top

Resources

Other resources about log/slog.

⬆ back to top

Blog posts

Blog posts about log/slog.

⬆ back to top

Creating slog

Resources documenting the creation of log/slog.

⬆ back to top

About

Collection of log/slog related projects.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published