{"id":13564183,"url":"https://github.com/motemen/go-loghttp","last_synced_at":"2025-04-06T06:11:02.577Z","repository":{"id":23980320,"uuid":"27363297","full_name":"motemen/go-loghttp","owner":"motemen","description":"Go library to log http.Client's requests and responses automatically","archived":false,"fork":false,"pushed_at":"2023-12-02T06:52:38.000Z","size":23,"stargazers_count":120,"open_issues_count":4,"forks_count":15,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-30T05:05:33.979Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/motemen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-12-01T04:56:12.000Z","updated_at":"2025-03-15T23:20:13.000Z","dependencies_parsed_at":"2024-06-18T14:16:26.856Z","dependency_job_id":null,"html_url":"https://github.com/motemen/go-loghttp","commit_stats":{"total_commits":16,"total_committers":2,"mean_commits":8.0,"dds":0.4375,"last_synced_commit":"29ae44b293f4e29b33f41f7f7674c80cbbfaeeb2"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/motemen%2Fgo-loghttp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/motemen%2Fgo-loghttp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/motemen%2Fgo-loghttp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/motemen%2Fgo-loghttp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/motemen","download_url":"https://codeload.github.com/motemen/go-loghttp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247441053,"owners_count":20939239,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T13:01:27.691Z","updated_at":"2025-04-06T06:11:02.562Z","avatar_url":"https://github.com/motemen.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"go-loghttp\n==========\n\nLog http.Client's requests and responses automatically.\n\n[PkgGoDev](https://pkg.go.dev/github.com/motemen/go-loghttp)\n\n## Synopsis\n\nTo log all the HTTP requests/responses, import `github.com/motemen/go-loghttp/global`.\n\n```go\npackage main\n\nimport (\n\t\"io\"\n\t\"log\"\n\t\"net/http\"\n\t\"os\"\n\n\t_ \"github.com/motemen/go-loghttp/global\" // Just this line!\n)\n\nfunc main() {\n\tresp, err := http.Get(os.Args[1])\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tio.Copy(os.Stdout, resp.Body)\n}\n```\n\n```\n% go run main.go http://example.com/\n2014/12/02 13:36:27 ---\u003e GET http://example.com/\n2014/12/02 13:36:27 \u003c--- 200 http://example.com/\n\u003c!doctype html\u003e\n...\n```\n\nOr set `loghttp.Transport` to `http.Client`'s `Transport` field.\n\n```go\nimport \"github.com/motemen/go-loghttp\"\n\nclient := \u0026http.Client{\n\tTransport: \u0026loghttp.Transport{},\n}\n```\n\nYou can modify [loghttp.Transport](http://godoc.org/github.com/motemen/go-loghttp#Transport)'s `LogRequest` and `LogResponse` to customize logging function.\n\n## Author\n\nmotemen \u003cmotemen@gmail.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmotemen%2Fgo-loghttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmotemen%2Fgo-loghttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmotemen%2Fgo-loghttp/lists"}