/slogdriver

Stackdriver Logging / GCP Cloud Logging handler for the go 1.21 slog package.

Primary LanguageGoISC LicenseISC

slogdriver

GoDoc CI status

Stackdriver Logging / GCP Cloud Logging handler for go the slog package for structured logging introduced in the standard library of go 1.21.

NOTE: slogdriver requires go 1.21.

Design Goals

  • Improved performance compared to using the JSONHandler with ReplaceAttr to achieve the same purpose. This is achieved by using goldjson under the hood.
  • Batteries included, e.g. builtin support for labels and traces. The trace information still needs to be provided separately as the library is agnostic as to which telemetry libraries (or versions) you choose to use. It is still highly advised to use OpenTelemetry.
  • Minimal dependencies.