Use golang structured logging (slog) with context. Add and retrieve logger to and from context. Add attributes to context. Automatically read any custom context values, such as OpenTelemetry TraceID.
veqryn/slog-context has 195 GitHub stars.
It currently ranks #30042 daily, #30460 weekly, #32151 monthly by momentum on Trending Repos; its best-ever rank is #9189.