Skip to main content
Use the Go handler when your application already logs through log/slog and you want the same records to flow into Squasher.

Installation

Configuration

Create one handler with your Squasher credentials, then build a slog.Logger from it.
main.go

Usage Example

main.go
The handler sends records asynchronously, so a final Flush() call is useful during shutdown paths, CLI commands, and tests.

Custom Attributes

Use WithAttrs() for shared fields and WithGroup() for nested attributes that should stay together.
main.go
Those attributes are preserved in the structured payload that Squasher receives, which makes them available for filtering and debugging.

Agent handoff