{"id":15372968,"url":"https://github.com/rs/golp","last_synced_at":"2025-04-15T12:31:51.223Z","repository":{"id":57519984,"uuid":"78339484","full_name":"rs/golp","owner":"rs","description":"Go panic logger","archived":false,"fork":false,"pushed_at":"2018-12-17T20:46:16.000Z","size":41,"stargazers_count":26,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T21:12:27.781Z","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/rs.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}},"created_at":"2017-01-08T11:46:35.000Z","updated_at":"2025-03-04T10:36:19.000Z","dependencies_parsed_at":"2022-09-05T09:41:32.931Z","dependency_job_id":null,"html_url":"https://github.com/rs/golp","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rs%2Fgolp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rs%2Fgolp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rs%2Fgolp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rs%2Fgolp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rs","download_url":"https://codeload.github.com/rs/golp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249072301,"owners_count":21208160,"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-10-01T13:53:50.895Z","updated_at":"2025-04-15T12:31:50.988Z","avatar_url":"https://github.com/rs.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go Log Panic\n\n[![godoc](http://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/rs/golp) [![license](http://img.shields.io/badge/license-MIT-red.svg?style=flat)](https://raw.githubusercontent.com/rs/golp/master/LICENSE) [![Build Status](https://travis-ci.org/rs/golp.svg?branch=master)](https://travis-ci.org/rs/golp) [![Coverage](http://gocover.io/_badge/github.com/rs/golp)](http://gocover.io/github.com/rs/golp)\n\nGo programs sometime generate output you can't easily control like panics and `net/http` recovered panics. By default, those output contains multiple lines with stack traces. This does not play well with most logging systems that will generate one log event per outputed line.\n\nThe `golp` is a simple program that reads those kinds of log on its standard input, and merge all lines of a given panic or standard multi-lines Go log message into a single quoted line.\n\n## Usage\n\nOptions:\n\n    -allow-json\n        Allow JSON input not to be escaped. When enabled, max-len is not efforced on JSON lines.\n    -ctx value\n        A key=value to add to the JSON output (can be repeated).\n    -json\n        Wrap messages to one JSON object per line.\n    -json-key string\n        The key name to use for the message in JSON mode. (default \"message\")\n    -max-len int\n        Strip messages to not exceed this length.\n    -output string\n        A file to append events to. Default output is stdout.\n    -prefix string\n        Go logger prefix set in the application if any.\n    -strip\n        Strip log line timestamps on output.\n\nSend panics and other program panics to syslog:\n\n    mygoprogram 2\u003e\u00261 | golp | logger -t mygoprogram -p local7.err\n\n    \u003e Jan  8 16:59:26 host mygoprogram: panic: panic: test\\n\\ngoroutine 1 [running]:\\npanic(0x…\n\nSend panics as JSON:\n\n    mygoprogram 2\u003e\u00261 | golp --json | logger -t mygoprogram -p local7.err\n\n    \u003e Jan  8 16:59:26 host mygoprogram: {\"message\":\"panic: panic: test\\n\\ngoroutine 1 [running]:\\npanic(0x…\n\nAdd context:\n\n    mygoprogram 2\u003e\u00261 | golp --json --ctx level=error --ctx program=mygoprogram\n\n    \u003e {\"level\":\"error\",\"program\":\"mygoprogram\",\"message\":\"panic: panic: test\\n\\ngoroutine 1 [running]:\\npanic(0x…\n\n## License\n\nAll source code is licensed under the [MIT License](https://raw.github.com/rs/golp/master/LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frs%2Fgolp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frs%2Fgolp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frs%2Fgolp/lists"}