{"id":42087848,"url":"https://github.com/mucansever/widelogger","last_synced_at":"2026-01-26T10:33:39.389Z","repository":{"id":331035429,"uuid":"1124963376","full_name":"mucansever/widelogger","owner":"mucansever","description":"package for wide logs containing all the context","archived":false,"fork":false,"pushed_at":"2026-01-17T16:27:04.000Z","size":27,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-18T00:06:19.486Z","etag":null,"topics":["go","golang","logging"],"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/mucansever.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-29T23:27:08.000Z","updated_at":"2026-01-17T16:27:07.000Z","dependencies_parsed_at":"2026-01-02T15:08:48.798Z","dependency_job_id":null,"html_url":"https://github.com/mucansever/widelogger","commit_stats":null,"previous_names":["mucansever/widelogger"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mucansever/widelogger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mucansever%2Fwidelogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mucansever%2Fwidelogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mucansever%2Fwidelogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mucansever%2Fwidelogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mucansever","download_url":"https://codeload.github.com/mucansever/widelogger/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mucansever%2Fwidelogger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28774653,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T09:42:00.929Z","status":"ssl_error","status_checked_at":"2026-01-26T09:42:00.591Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["go","golang","logging"],"created_at":"2026-01-26T10:33:38.820Z","updated_at":"2026-01-26T10:33:39.384Z","avatar_url":"https://github.com/mucansever.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# widelogger\n\nContext-based structured logging for Go with field accumulation. Collects log fields throughout a request lifecycle and emits them all at once. \n\nInspired by: https://loggingsucks.com\n\n## Installation\n```bash\ngo get github.com/mucansever/widelogger\n```\n\n## Basic Usage\nAccumulate fields in `context.Context` and log them together.\n\n```go\nctx := widelogger.NewContext(context.Background())\nwidelogger.AddFields(ctx, \"user_id\", 123)\nwidelogger.AddWarning(ctx, \"slow query\", \"ms\", 500)\nwidelogger.Info(ctx, \"request completed\")\n```\n\n## HTTP Middleware\nYou can transform your HTTP request lifecycles into widelogs easily with the middleware.\n\n```go\nmux := http.NewServeMux()\n\nhandler := widelogger.Middleware(mux,\n    widelogger.WithIncludeRequestHeaders(\"User-Agent\"),\n    widelogger.WithExcludePaths(\"/health\"),\n    // log only 10% of successful requests to save space.\n    // requests with warnings, errors, or status \u003e= 400 are always logged.\n    widelogger.WithSuccessSampling(0.1), \n)\n\nhttp.ListenAndServe(\":8080\", handler)\n```\n\n## Why widelogger?\nInstead of multiple scattered log lines, you get one \"wide\" log entry containing everything that happened during that request.\n\n```json\n{\n  \"time\": \"2026-01-17T12:00:00Z\",\n  \"level\": \"INFO\",\n  \"msg\": \"http_request_completed\",\n  \"method\": \"GET\",\n  \"path\": \"/api/user\",\n  \"user_id\": 123,\n  \"duration_ms\": 45,\n  \"status_code\": 200,\n  \"warnings\": [{\"message\": \"slow query\", \"fields\": {\"ms\": 500}}]\n}\n```\n\nYou can play with the sample server provided in `examples/basic/server.go` by running it with `go run examples/basic/server.go`.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmucansever%2Fwidelogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmucansever%2Fwidelogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmucansever%2Fwidelogger/lists"}