{"id":49389129,"url":"https://github.com/gringolito/fiberslog","last_synced_at":"2026-04-28T11:09:30.844Z","repository":{"id":353218116,"uuid":"1211017753","full_name":"gringolito/fiberslog","owner":"gringolito","description":"Fiber middleware for structured request logging with `slog`","archived":false,"fork":false,"pushed_at":"2026-04-22T23:29:09.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-23T01:23:42.370Z","etag":null,"topics":["fiber","fiber-framework","fiber-go","golang","golang-module","logger-middleware","middleware","slog"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gringolito.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-15T01:46:23.000Z","updated_at":"2026-04-22T23:29:12.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/gringolito/fiberslog","commit_stats":null,"previous_names":["gringolito/fiberslog"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/gringolito/fiberslog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gringolito%2Ffiberslog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gringolito%2Ffiberslog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gringolito%2Ffiberslog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gringolito%2Ffiberslog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gringolito","download_url":"https://codeload.github.com/gringolito/fiberslog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gringolito%2Ffiberslog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32377648,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T09:24:15.638Z","status":"ssl_error","status_checked_at":"2026-04-28T09:24:15.071Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["fiber","fiber-framework","fiber-go","golang","golang-module","logger-middleware","middleware","slog"],"created_at":"2026-04-28T11:09:30.104Z","updated_at":"2026-04-28T11:09:30.830Z","avatar_url":"https://github.com/gringolito.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fiberslog\n\n[![CI](https://github.com/gringolito/fiberslog/actions/workflows/ci.yaml/badge.svg)](https://github.com/gringolito/fiberslog/actions/workflows/ci.yaml)\n[![CodeQL](https://github.com/gringolito/fiberslog/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/gringolito/fiberslog/actions/workflows/github-code-scanning/codeql)\n[![codecov](https://codecov.io/gh/gringolito/fiberslog/branch/master/graph/badge.svg)](https://codecov.io/gh/gringolito/fiberslog)\n[![Go Reference](https://pkg.go.dev/badge/github.com/gringolito/fiberslog.svg)](https://pkg.go.dev/github.com/gringolito/fiberslog)\n![Go 1.24+](https://img.shields.io/badge/go-%3E%3D1.24-blue)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\nFiber middleware for structured request logging with `slog`.\n\n## Install\n\n```bash\ngo get github.com/gringolito/fiberslog\n```\n\n## Usage\n\n```go\nimport (\n    \"log/slog\"\n\n    \"github.com/gofiber/fiber/v2\"\n    \"github.com/gringolito/fiberslog\"\n)\n\napp := fiber.New()\nlogger := slog.Default()\n\napp.Use(fiberslog.New(fiberslog.Config{\n    Logger: logger,\n    Fields: []string{\"latency\", \"status\", \"method\", \"path\", \"requestId\"},\n}))\n```\n\n## Features\n\n- Configurable logged fields (22 built-in fields, see reference below)\n- URI skip list\n- Conditional body and response body logging\n- Automatic level mapping based on HTTP status code (2xx→Info, 4xx→Warn, 5xx→Error)\n- Sensitive header redaction via `SkipHeaders`\n\n## Field Reference\n\nThe `Fields` config option accepts any combination of the names below. Unknown names are silently ignored. The default set is `latency`, `status`, `method`, `url`, `pid`.\n\n| Field | Log attribute key | Type | Description |\n| --- | --- | --- | --- |\n| `latency` | `latency` | `time.Duration` | Time to process the request |\n| `status` | `status` | `int` | HTTP response status code |\n| `method` | `method` | `string` | HTTP request method |\n| `url` | `url` | `string` | Full original URL (includes query string) |\n| `path` | `path` | `string` | Request path without query string |\n| `pid` | `pid` | `int` | Process ID |\n| `ip` | `ip` | `string` | Client IP address |\n| `ips` | `ips` | `string` | `X-Forwarded-For` header value |\n| `host` | `host` | `string` | Request hostname |\n| `port` | `port` | `string` | Request port |\n| `protocol` | `protocol` | `string` | Request protocol (`http` or `https`) |\n| `referer` | `referer` | `string` | `Referer` header value |\n| `user-agent` | `user-agent` | `string` | `User-Agent` header value |\n| `requestId` | `requestId` | `string` | `X-Request-ID` response header |\n| `route` | `route` | `string` | Matched Fiber route pattern |\n| `queryParams` | `queryParams` | `string` | Serialized query parameters |\n| `body` | `body` | `[]byte` | Request body bytes |\n| `responseBody` | `responseBody` | `[]byte` | Response body bytes |\n| `bytesReceived` | `bytesReceived` | `int` | Request body size in bytes |\n| `bytesSent` | `bytesSent` | `int` | Response body size in bytes |\n| `requestHeaders` | _(one attr per header)_ | `[]byte` | All request headers (**see Security**) |\n| `responseHeaders` | _(one attr per header)_ | `[]byte` | All response headers (**see Security**) |\n\n## Security\n\n**`requestHeaders` and `responseHeaders`** log all headers verbatim, including `Authorization`, `Cookie`, and API keys. Use `SkipHeaders` to redact sensitive ones:\n\n```go\napp.Use(fiberslog.New(fiberslog.Config{\n    Fields:      []string{\"latency\", \"status\", \"method\", \"requestHeaders\"},\n    SkipHeaders: []string{\"Authorization\", \"Cookie\"},\n}))\n```\n\nHeader name matching is case-insensitive.\n\n## Contributing\n\nContributions are welcome! Feel free to:\n\n- [Open an issue](https://github.com/gringolito/fiberslog/issues) to report a bug or request a new feature\n- Submit a pull request — please include tests for any new behavior\n- Suggest ideas or improvements by starting a [discussion](https://github.com/gringolito/fiberslog/discussions)\n\n---\n\n_This project has moved from the Beerware License to MIT, but the spirit lives on: if we ever meet and you think this stuff is worth it, you're still very welcome to buy me a beer._\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgringolito%2Ffiberslog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgringolito%2Ffiberslog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgringolito%2Ffiberslog/lists"}