{"id":21349132,"url":"https://github.com/halink0803/zerolog-graylog-hook","last_synced_at":"2025-07-12T18:32:16.384Z","repository":{"id":78301115,"uuid":"142425526","full_name":"halink0803/zerolog-graylog-hook","owner":"halink0803","description":"This is a hook to send log to graylog, support GELF","archived":false,"fork":false,"pushed_at":"2024-05-01T14:20:26.000Z","size":4,"stargazers_count":6,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-19T18:08:16.132Z","etag":null,"topics":["hacktoberfest","hacktoberfest2021"],"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/halink0803.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":"2018-07-26T10:25:17.000Z","updated_at":"2023-02-24T13:15:11.000Z","dependencies_parsed_at":"2024-06-19T17:35:37.829Z","dependency_job_id":null,"html_url":"https://github.com/halink0803/zerolog-graylog-hook","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halink0803%2Fzerolog-graylog-hook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halink0803%2Fzerolog-graylog-hook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halink0803%2Fzerolog-graylog-hook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/halink0803%2Fzerolog-graylog-hook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/halink0803","download_url":"https://codeload.github.com/halink0803/zerolog-graylog-hook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225834495,"owners_count":17531468,"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":["hacktoberfest","hacktoberfest2021"],"created_at":"2024-11-22T02:42:36.803Z","updated_at":"2024-11-22T02:42:37.573Z","avatar_url":"https://github.com/halink0803.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Graylog hook for [zerolog](https://github.com/rs/zerolog)\n\nThis is a hook to send log to graylog, support GELF.\n\n## Usage\n\nSample code using graylog hook\n\n```golang\nimport (\n    \"github.com/halink0803/zerolog-graylog-hook/graylog\"\n    \"github.com/rs/zerolog\"\n    \"github.com/rs/zerolog/log\"\n)\n\nfunc main() {\n    // set default logger to print to stdout and prettify    \n\tlog.Logger = zerolog.New(os.Stdout).With().Timestamp().Caller().Logger().Output(zerolog.ConsoleWriter{Out: os.Stderr})  \n    // udp://127.0.0.1:12201 is log udp url \n\thook, err := graylog.NewGraylogHook(\"udp://127.0.0.1:12201\")\n\tif err != nil {\n\t\tpanic(err)\n    }\n    //Set global logger with graylog hook\n    log.Logger = log.Hook(hook)\n    \n    // Print and send sample log\n    for range time.Tick(time.Millisecond * 200) {\n\t\tfor range time.Tick(time.Millisecond * 200) {\n\t\t\tlog.Info.Msg(\"info log\")\n            log.Warn.Msg(\"warning log\")\n            log.Debug.Msg(\"debug log\")\n\t\t}\n\t}\n}\n```\n\n*Note: When you first install Graylog, remember to go to /system/inputs to enable GELF input*","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalink0803%2Fzerolog-graylog-hook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhalink0803%2Fzerolog-graylog-hook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalink0803%2Fzerolog-graylog-hook/lists"}