loopbackio / loopbackio/loopback-next

Logging Extension Improvements

Aperta
#5,464 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

feature
Lingua principale
TypeScript
Stelle
5.1k
Fork
1.1k
Merge medio
2g 21h
PR unite (30g)
27

Descrizione

Suggestion

  • should include a global logger for use outside of the application so that we can make sure to catch and log exceptions for problems with the application boot-up. console.log won't cut it here as logs still need to be json structured and sent to an external logging service.

  • Http Access Logs should be json structured rather than putting the log in string format.

Use Cases

I'm deploying my application to Google App Engine and structure logs for both normal logs as well as error logs is an absolute must to correctly parse any problems.

Examples

Logging should be tightly integrated with the application. A global logger should be setup and passed into the application as part of the application initialisation (I suggest simply choosing winston by convention). The global logger can then be accessed by the migration scripts, and can also be used inside the main function for circumstances where the application doesn't boot.

The HTTP Access Logger should be a middleware that takes a callback with some for such as:

LogCallbackFn(logger: WinstonLogger, req: Request, res: Response)

This way the logger call can be customised.

Acceptance criteria

TBD - will be filled by the team.

Guida per i contributori

Apri la guida per i contributori

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.

Direzione di ricerca

Inizia individuando il percorso di inizializzazione dell’applicazione, gli script di migrazione, la funzione main e il middleware di logging degli accessi HTTP. Chiarisci con il team i criteri di accettazione mancanti, quindi definisci il completamento in modo che sia disponibile un logger strutturato globale durante l’avvio e le migrazioni, oltre a log di accesso HTTP JSON personalizzabili adatti ai servizi esterni.

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

Valutazione

Stack tecnologico
google-cloud, node.js, typescript
Ambito
api, backend, observability
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
20/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.