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

customize log format

Aperta
#283 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
42/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
go
Ambito
api, backend

Direzione di ricerca

Start by locating the rest-server command's existing --log output path and how its current access-log format is produced. Add the requested --logformat option with timestamp-style formatting, while preserving the existing request fields; done means logs can use the sortable example format and the current logging behavior remains available.

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

Descrizione

Output of rest-server --version

rest-server version rest-server 0.12.1 compiled with go1.20.5 on linux/386

What should rest-server do differently?

Add an option --logformat

What are you trying to do? What is your use case?

The log file has entries of this format:

129.69.202.138 - - [10/May/2024:09:38:26 +0200] "HEAD /test/config HTTP/2.0" 200 0 "" "Go-http-client/2.0"

But I prefer:

[2024-05-10 09:38:26] 129.69.202.138 - - "HEAD /test/config HTTP/2.0" 200 0 "" "Go-http-client/2.0"

Because it is easy sortable.

So, a new option like this would be great:

--logformat "[%Y-%m-%d %H:%M:%S] ..."

My workaround so far is:

rest-server $OTHER_OPTIONS --log - | perl_log_converter >> $DATA/log

Did rest-server help you today? Did it make you happy in any way?

Lingua principale
Go
Stelle
1.5k
Fork
179
Merge medio
15g 9h
PR unite (30g)
2

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Ha un modello di pull request
  • Nessuna 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.

Altre issue di restic/rest-server

Tutte le issue di restic/rest-server

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.