{"id":15061792,"url":"https://github.com/elafarge/gin-http-logger","last_synced_at":"2025-04-10T09:45:32.056Z","repository":{"id":57483445,"uuid":"79215838","full_name":"elafarge/gin-http-logger","owner":"elafarge","description":"An HTTP access log forwarder for the Gin-Gonic web framework.","archived":false,"fork":false,"pushed_at":"2017-11-27T17:32:37.000Z","size":25,"stargazers_count":6,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T08:41:55.995Z","etag":null,"topics":["fluentd","gin","gin-gonic","http","https","logging","middleware"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elafarge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-17T10:23:45.000Z","updated_at":"2022-11-22T16:16:18.000Z","dependencies_parsed_at":"2022-08-27T21:02:30.927Z","dependency_job_id":null,"html_url":"https://github.com/elafarge/gin-http-logger","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elafarge%2Fgin-http-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elafarge%2Fgin-http-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elafarge%2Fgin-http-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elafarge%2Fgin-http-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elafarge","download_url":"https://codeload.github.com/elafarge/gin-http-logger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248196310,"owners_count":21063392,"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":["fluentd","gin","gin-gonic","http","https","logging","middleware"],"created_at":"2024-09-24T23:25:10.686Z","updated_at":"2025-04-10T09:45:32.012Z","avatar_url":"https://github.com/elafarge.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Gin-Gonic HTTP log forwarder\n============================\n\nA Gin-Gonic middleware forwarding access logs over HTTP (in JSON). It can be\nused for instance to forward all your requests logs to a Fluentd HTTP listener.\n\nFeatures\n--------\n * Non blocking: heavy calls made in a goroutine separated from the GIN handler\n   one.\n * Possible to log the request \u0026 response bodies all the time, when the handler\n   returns an error code (4xx, 5xx) or never\n * Memory efficient: uses the standard `io` library abstractions to limit\n   what's loaded in memory, body logs are truncated to 10000 bytes by default,\n   in case of connection failure with the HTTP endpoint, no more than 1000 logs\n   will be kept in memory. These values can be tweaked to your liking.\n * Lightweight but complete\n\nUsage\n-----\n\nLike any other Gin-Gonic middleware:\n\n```golang\nimport (\n  // ...\n  httpLogger \"github.com/elafarge/gin-http-logger\"\n  \"github.com/gin-gonic/gin\"\n  // ...\n)\n\n// ...\n\n  r := gin.Default()\n\n\thttpLoggerConf := httpLogger.FluentdLoggerConfig{\n\t\tHost:           \"localhost\",\n\t\tPort:           13713,\n\t\tEnv:            \"etienne-kubernetes\",\n\t\tTag:            \"gin.requests\",\n\t\tBodyLogPolicy:  httpLogger.LOG_BODIES_ON_ERROR,\n\t\tMaxBodyLogSize: 50,\n\t\tDropSize:       5,\n\t\tRetryInterval:  5,\n\t}\n\n\tr.Use(httpLogger.New(httpLoggerConf))\n```\n\n### Compatible with\n * FluentD (tested)\n\n### Author\n * Étienne Lafarge \u003cetienne@rythm.co\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felafarge%2Fgin-http-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felafarge%2Fgin-http-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felafarge%2Fgin-http-logger/lists"}