tus / tusd

Reference server implementation in Go of tus: the open protocol for resumable file uploads
https://tus.github.io/tusd
MIT License
3.05k stars 475 forks source link

feat: Allow users to set json log output #1026

Closed NoUseFreak closed 10 months ago

NoUseFreak commented 11 months ago

Add -format=json options to allow logging in json format.

{"time":"2023-11-04T11:17:26.702372+01:00","level":"INFO","msg":"Using '/workdir/tusd/data' as directory storage."}
{"time":"2023-11-04T11:17:26.702557+01:00","level":"INFO","msg":"Using 0.00MB as maximum size."}
{"time":"2023-11-04T11:17:26.702594+01:00","level":"INFO","msg":"Supported tus extensions: creation,creation-with-upload,termination,concatenation,creation-defer-length"}
{"time":"2023-11-04T11:17:26.7026+01:00","level":"INFO","msg":"Using 0.0.0.0:8080 as address to listen."}
{"time":"2023-11-04T11:17:26.702603+01:00","level":"INFO","msg":"Using /files/ as the base path."}
{"time":"2023-11-04T11:17:26.702631+01:00","level":"INFO","msg":"Using /metrics as the metrics path."}
{"time":"2023-11-04T11:17:26.702947+01:00","level":"INFO","msg":"You can now upload files to: http://[::]:8080/files/"}
Acconut commented 10 months ago

Thank you for the PR! I has been merged in https://github.com/tus/tusd/commit/9b6ada97f0662100be607f48c25effd84150a718 🎉 I apologize that your authorship of this commit got lost when I added a commit locally and squashed them together.