src-d / borges

borges collects and stores Git repositories.
https://docs.sourced.tech/borges/
GNU General Public License v3.0
52 stars 20 forks source link

Add meaningful log messages that can be searched in kibana #364

Open jfontan opened 6 years ago

jfontan commented 6 years ago

Current log messages do not offer enough information to debug malfunction or trends in repositories. Ideas of information that can be useful:

{"endpoint":"git://github.com/dgreenhalgh/2010fwr","job":"01640b27-c7c4-0d83-0dc0-da776c9d9d22","level":"info","msg":"job finished successfully","source":"borges/archiver.go:113","time":"2018-10-17T09:59:32.484614868Z"}

{"label":"job-finished", "duration":1234, "success": true, "endpoint":"git://github.com/dgreenhalgh/2010fwr","job":"01640b27-c7c4-0d83-0dc0-da776c9d9d22","level":"info","msg":"job finished successfully","source":"borges/archiver.go:113","time":"2018-10-17T09:59:32.484614868Z"}
{"endpoint":"git://github.com/justindlea/datasharing","error":"push to rooted repo 1880dc904e1b2774be9c97a7b85efabdb910f974 failed: copy was cancelled","job":"01640b1f-8dc2-9d9f-5848-e209c33a49a4","level":"error","msg":"error pushing changes to rooted repository","root":"1880dc904e1b2774be9c97a7b85efabdb910f974","source":"borges/archiver.go:340","time":"2018-10-17T09:10:01.150989825Z"}
{"endpoint":"git://github.com/justindlea/datasharing","job":"01640b1f-8dc2-9d9f-5848-e209c33a49a4","level":"debug","msg":"repository processed","source":"borges/archiver.go:134","status":"pending","time":"2018-10-17T09:10:01.250793153Z"}
{"endpoint":"git://github.com/justindlea/datasharing","error":"repository processed with errors: archiving 1 out of 1 roots failed: 1880dc904e1b2774be9c97a7b85efabdb910f974","job":"01640b1f-8dc2-9d9f-5848-e209c33a49a4","level":"error","msg":"job finished with error","source":"borges/archiver.go:109","time":"2018-10-17T09:10:01.250880742Z"}

{"label": "job-finished", "duration": 1234, "success": false, "cause": "timeout acquiring lock", "root": "1880dc904e1b2774be9c97a7b85efabdb910f974", "endpoint":"git://github.com/justindlea/datasharing","error":"repository processed with errors: archiving 1 out of 1 roots failed: 1880dc904e1b2774be9c97a7b85efabdb910f974","job":"01640b1f-8dc2-9d9f-5848-e209c33a49a4","level":"error","msg":"job finished with error","source":"borges/archiver.go:109","time":"2018-10-17T09:10:01.250880742Z"}