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...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help