{"id":24127040,"url":"https://github.com/sohlich/elogrus","last_synced_at":"2025-04-04T09:09:44.444Z","repository":{"id":50853917,"uuid":"49322545","full_name":"sohlich/elogrus","owner":"sohlich","description":"Logrus Hook for ElasticSearch","archived":false,"fork":false,"pushed_at":"2024-06-04T12:35:19.000Z","size":46,"stargazers_count":158,"open_issues_count":13,"forks_count":50,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-28T08:08:19.237Z","etag":null,"topics":["elasticsearch","golang","logging","logrus"],"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/sohlich.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}},"created_at":"2016-01-09T11:58:37.000Z","updated_at":"2025-01-03T21:44:59.000Z","dependencies_parsed_at":"2024-06-20T16:25:09.773Z","dependency_job_id":null,"html_url":"https://github.com/sohlich/elogrus","commit_stats":{"total_commits":63,"total_committers":11,"mean_commits":"5.7272727272727275","dds":0.4444444444444444,"last_synced_commit":"7aa9ea83194366e07d0936b6d7e1e62be2b64b25"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sohlich%2Felogrus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sohlich%2Felogrus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sohlich%2Felogrus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sohlich%2Felogrus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sohlich","download_url":"https://codeload.github.com/sohlich/elogrus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247149502,"owners_count":20891954,"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":["elasticsearch","golang","logging","logrus"],"created_at":"2025-01-11T17:26:30.409Z","updated_at":"2025-04-04T09:09:44.424Z","avatar_url":"https://github.com/sohlich.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ElasticSearch Hook for [Logrus](https://github.com/Sirupsen/logrus) \u003cimg src=\"http://i.imgur.com/hTeVwmJ.png\" width=\"40\" height=\"40\" alt=\":walrus:\" class=\"emoji\" title=\":walrus:\"/\u003e\n\u003cimg src=\"https://travis-ci.org/sohlich/elogrus.svg?branch=master\" /\u003e\n\n## Releases\n**Notice that the master branch always refers to the latest version of Elastic. If you want to use stable versions of elogus, you should use the packages released via [gopkg.in](https://gopkg.in).**\n\n*Here's the version matrix:*\n\nElasticSearch version | Elastic version  | Package URL                              | Remarks |\n----------------------|------------------|------------------------------------------|---------|\n7.x                   | 7.0              | [`gopkg.in/sohlich/elogrus.v7`](http://gopkg.in/sohlich/elogrus.v7)| Use Go modules.\n6.x                   | 6.0              | [`gopkg.in/sohlich/elogrus.v3`](http://gopkg.in/sohlich/elogrus.v3)| Actively maintained.\n5.x                   | 5.0              | [`gopkg.in/sohlich/elogrus.v2`](http://gopkg.in/sohlich/elogrus.v2)| Actively maintained.\n2.x                   | 3.0              | [`gopkg.in/sohlich/elogrus.v1`](http://gopkg.in/sohlich/elogrus.v1)| Deprecated. Please update.\n\n*For elastic search 7.x*\n```bash\n# We name v7 to align with elastic v7\ngo get gopkg.in/sohlich/elogrus.v7\ngo get github.com/olivere/elastic/v7\n```\n\n*For elastic search 6.x*\n```bash\ngo get gopkg.in/sohlich/elogrus.v3\ngo get github.com/olivere/elastic\n\n```\n\n*For elastic search 5.x*\n```bash\ngo get gopkg.in/sohlich/elogrus.v2\ngo get gopkg.in/olivere/elastic.v5\n\n```\n\n## Changelog\n- elastic 7.x support (currently in master)\n\n## Usage\n\n```go\npackage main\n\nimport (\n\t\"github.com/olivere/elastic/v7\"\n\t\"github.com/sirupsen/logrus\"\n\t\"gopkg.in/sohlich/elogrus.v7\"\n)\n\nfunc main() {\n\tlog := logrus.New()\n\tclient, err := elastic.NewClient(elastic.SetURL(\"http://localhost:9200\"))\n\tif err != nil {\n\t\tlog.Panic(err)\n\t}\n\thook, err := elogrus.NewAsyncElasticHook(client, \"localhost\", logrus.DebugLevel, \"mylog\")\n\tif err != nil {\n\t\tlog.Panic(err)\n\t}\n\tlog.Hooks.Add(hook)\n\n\tlog.WithFields(logrus.Fields{\n\t\t\"name\": \"joe\",\n\t\t\"age\":  42,\n\t}).Error(\"Hello world!\")\n}\n```\n\n### Asynchronous hook\n\n```go\n\t...\n\telogrus.NewAsyncElasticHook(client, \"localhost\", logrus.DebugLevel, \"mylog\")\n\t...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsohlich%2Felogrus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsohlich%2Felogrus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsohlich%2Felogrus/lists"}