I released my first public Go package: a structured logging toolkit (Zap + PostgreSQL). Feedback welcome!
github.com·7h·
Discuss: r/golang
Flag this post

Better Logs

A lightweight, production‑ready logging toolkit designed for Go services that want structured logs, database persistence, and framework‑agnostic HTTP middleware, without relying on any external SaaS.

This README provides:

Overview

Why this package exists

Install

Basic usage

HTTP middleware

Postgres log core (batch writer)

Context fields

Integration examples

  • net/http
  • Echo

Best practices (PII, redaction, retention)

Technical choices


📌 Overview

Better Logs is a small, focused toolkit that provides:

  • A Zap core that writes logs into PostgreSQL in batches
  • A generic HTTP middleware compatible with any net/http router
  • Context‑based structured logging fields (similar to logctx)
  • Safe batching…

Similar Posts

Loading similar posts...