{"id":31025753,"url":"https://github.com/unitvectory-labs/gologhttpjson","last_synced_at":"2025-09-13T17:12:19.737Z","repository":{"id":312556559,"uuid":"1047872378","full_name":"UnitVectorY-Labs/gologhttpjson","owner":"UnitVectorY-Labs","description":"A lightweight HTTP server for logging requests, with body capture, opt-in headers, and environment variable metadata.","archived":false,"fork":false,"pushed_at":"2025-08-31T14:05:52.000Z","size":15,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-31T15:11:10.775Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/UnitVectorY-Labs.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":"2025-08-31T12:31:57.000Z","updated_at":"2025-08-31T14:05:55.000Z","dependencies_parsed_at":"2025-08-31T15:11:18.002Z","dependency_job_id":null,"html_url":"https://github.com/UnitVectorY-Labs/gologhttpjson","commit_stats":null,"previous_names":["unitvectory-labs/gologhttpjson"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/UnitVectorY-Labs/gologhttpjson","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnitVectorY-Labs%2Fgologhttpjson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnitVectorY-Labs%2Fgologhttpjson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnitVectorY-Labs%2Fgologhttpjson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnitVectorY-Labs%2Fgologhttpjson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UnitVectorY-Labs","download_url":"https://codeload.github.com/UnitVectorY-Labs/gologhttpjson/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UnitVectorY-Labs%2Fgologhttpjson/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274997547,"owners_count":25387934,"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","status":"online","status_checked_at":"2025-09-13T02:00:10.085Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-09-13T17:12:17.057Z","updated_at":"2025-09-13T17:12:19.721Z","avatar_url":"https://github.com/UnitVectorY-Labs.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![GitHub release](https://img.shields.io/github/release/UnitVectorY-Labs/gologhttpjson.svg)](https://github.com/UnitVectorY-Labs/gologhttpjson/releases/latest) [![License](https://img.shields.io/badge/license-MIT-blue)](https://opensource.org/licenses/MIT) [![Active](https://img.shields.io/badge/Status-Active-green)](https://guide.unitvectorylabs.com/bestpractices/status/#active) [![Go Report Card](https://goreportcard.com/badge/github.com/UnitVectorY-Labs/gologhttpjson)](https://goreportcard.com/report/github.com/UnitVectorY-Labs/gologhttpjson)\n\n# gologhttpjson\n\nA lightweight HTTP server that logs HTTP requests containing JSON payloads, with optional header logging and environment-based metadata.\n\n## Purpose\n\nThis application captures incoming HTTP POST requests and logs the JSON body, request path, optional headers, and environment variable metadata. It is useful for debugging, testing, and local development when you want to inspect JSON payloads and related request context.\n\n**Why use this?** This tool provides a simple way to log JSON requests for debugging, testing, and inspection. It allows for opt-in logging of request headers and provides a mechanism to inject metadata from environment variables.\n\n**Should I run this in production?** No. This could expose sensitive information from headers and payloads. It is intended strictly for debugging, development, and testing.\n\n## Usage\n\nThe latest gologhttpjson Docker image is available for deployment from GitHub Packages at [gologhttpjson on GitHub Packages](https://github.com/UnitVectorY-Labs/gologhttpjson/pkgs/container/gologhttpjson).\n\nYou can deploy this application locally with Docker:\n\n```bash\ndocker run -p 8080:8080 ghcr.io/unitvectory-labs/gologhttpjson:latest\n```\n\n## Example Log Output\n\nAll responses return an HTTP 200 status code with a body of `OK`. This application is designed to log request payloads for inspection.\n\nThe log output is structured as JSON with the following attributes:\n\n- `body` – the original JSON payload\n- `path` – the HTTP request path\n- `headers` – optional, logged if `LOG_HEADERS` is set\n- `metadata` – optional, populated from environment variables prefixed with `METADATA_`\n\nExample (pretty-printed for readability):\n\n```json\n{\n  \"body\": {\n    \"event\": \"user.created\",\n    \"data\": {\"id\": 123}\n  },\n  \"headers\": {\n    \"Authorization\": \"Bearer token123\",\n    \"Content-Type\": \"application/json\",\n    \"User-Agent\": \"curl/7.68.0\"\n  },\n  \"metadata\": {\n    \"SERVICE\": \"api\",\n    \"VERSION\": \"1.0\"\n  },\n  \"path\": \"/api/webhook\"\n}\n```\n\n## Configuration\n\nThis application runs as a Docker container or via Go directly. It supports the following environment variables:\n\n- `PORT` – the port the application listens on (default `8080`)\n- `LOG_HEADERS` – set to any non-empty value to enable logging of HTTP headers\n- `METADATA_*` – any environment variable prefixed with `METADATA_` will be logged under the `metadata` field\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funitvectory-labs%2Fgologhttpjson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funitvectory-labs%2Fgologhttpjson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funitvectory-labs%2Fgologhttpjson/lists"}