Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

unified logging pattern & facilities

Aperta
#53 1 commento 4 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
go

Direzione di ricerca

Start by inspecting the salt/log package and its consumers to map the current Logrus/Zap abstraction, then check the mux package for logging-related middleware. Done means the formatted-logger abstraction is removed, Salt and ODPF usage assumes Zap structured logging, and any retained context helpers are explicitly justified.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Currently salt/log package tries to abstract Logrus and Zap into a common formatted-logger interface (i.e., Infof(msg string, args ...any), etc. ). While logrus is designed as a formatted-logger, uber/zap is specifically designed for efficient structured logging and this kind of abstraction nullifies the major benefit of it.

I propose we remove this abstraction altogether[^1] and assume direct usage of zap within salt and in ODPF applications that use salt. Benefits of doing this:

  • All the benefits of structured logging (easy to parse logs, easy to search/filter by field values, easy to attach request context with each log, etc.)
  • Not giving an abstracted formatted-logger will force us to always stick to structured logging.
  • Assuming zap as the logger of choice allows us to provide certain useful utility abstractions. Few examples:
    * A request-logging middleware in mux package that automatically logs request info (method, path, client-ip, etc.) and response info (status, response time, etc.)
    * A middleware for injecting request related context (req-id, current user id, the route info, etc.) into req.Context() so that every log in all the subsequent layers automatically add this to every log entry.

[^1]: We can still have some utility functions if we need to (e.g., a helper to inject log context into ctx). But attempting to abstract over logging functionality will not have justifiable benefits.

Lingua principale
Go
Stelle
14
Fork
8
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di raystack/salt

Tutte le issue di raystack/salt

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.