Skip to content

Better Stack Logs SDK

Grow Codes CI License

One API for Better Stack Logs in five languages: TypeScript, Rust, Go, Python and Java. Every package has the same functions, options, defaults, error codes and behaviour, tested in Docker against a contract-verified Better Stack stub (ingest host + ClickHouse-HTTP SQL host).

Language Package Coverage
TypeScript @grow-codes/better-stack-logs TypeScript coverage
Rust grow-better-stack-logs Rust coverage
Go github.com/grow-codes-packages/better-stack-logs/go Go coverage
Python grow-better-stack-logs Python coverage
Java codes.grow.packages:better-stack-logs Java coverage

What you get

  • Client with health and authenticated ping on both Better Stack hosts, each with its own credentials (Client).
  • Ingest as JSON, NDJSON or MessagePack with gzip and dt timestamps, plus an OTLP/HTTP logs exporter (Ingest).
  • SQL query through the ClickHouse HTTP interface with server-side parameters, searchLogs over hot and cold storage and waitForLog (SQL query).
  • Configuration from code or GROW_BETTER_STACK_LOGS_* / vendor environment variables, immutable and validated (Configuration).
  • Retries with full-jitter backoff and Retry-After, connect/request/total timeouts and cancellation in every language.
  • Typed errors with one set of codes across languages (Error handling).
  • Redaction everywhere: credentials never appear in errors, logs, hooks or toString (Redaction).
  • Logging: batching log client, logger facade, redaction processor, framework adapters and log search (Logging).
  • Every function with examples in all five languages (Functions).

Start with Install and the Quickstart.

Independent project

This SDK is made by Grow Codes. Better Stack Logs is a trademark of Better Stack, Inc. This project is not affiliated with or endorsed by Better Stack, Inc. See License & disclaimer.