{"id":13983393,"url":"https://github.com/onrik/logrus","last_synced_at":"2025-05-16T11:06:21.126Z","repository":{"id":14845853,"uuid":"74812698","full_name":"onrik/logrus","owner":"onrik","description":"Hooks for logrus logging","archived":false,"fork":false,"pushed_at":"2024-07-25T10:28:31.000Z","size":81,"stargazers_count":122,"open_issues_count":6,"forks_count":30,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-09T05:06:28.876Z","etag":null,"topics":["echo","gin","gin-gonic","gin-middleware","golang","gorm","gorm-orm","logging","logrus","sentry","sentry-client"],"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/onrik.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-11-26T07:59:30.000Z","updated_at":"2024-03-28T07:19:37.000Z","dependencies_parsed_at":"2024-01-07T09:39:39.350Z","dependency_job_id":"a53054b2-0c9b-441a-af1a-4404cf5950e4","html_url":"https://github.com/onrik/logrus","commit_stats":{"total_commits":56,"total_committers":10,"mean_commits":5.6,"dds":0.2857142857142857,"last_synced_commit":"455c970bfab6286433169b6db8cccd45a3a98f2a"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onrik%2Flogrus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onrik%2Flogrus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onrik%2Flogrus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onrik%2Flogrus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onrik","download_url":"https://codeload.github.com/onrik/logrus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254518383,"owners_count":22084374,"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":["echo","gin","gin-gonic","gin-middleware","golang","gorm","gorm-orm","logging","logrus","sentry","sentry-client"],"created_at":"2024-08-09T05:01:44.968Z","updated_at":"2025-05-16T11:06:16.117Z","avatar_url":"https://github.com/onrik.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Hooks for [logrus](https://github.com/Sirupsen/logrus)\n\n## Example\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n\n    \"github.com/onrik/logrus/filename\"\n    \"github.com/onrik/logrus/sentry\"\n    log \"github.com/sirupsen/logrus\"\n)\n\nvar (\n    dsn = \"http://60a0257d7b5a429a8838e5f2ba873ec9@example.com/1\"\n)\n\nfunc main() {\n    filenameHook := filename.NewHook()\n    filenameHook.Field = \"custom_source_field\" // Customize source field name\n    log.AddHook(filenameHook)\n\n    sentryHook, err := sentry.NewHook(sentry.Options{\n        Dsn: dsn,\n    }, log.PanicLevel, log.FatalLevel, log.ErrorLevel)\n    if err != nil {\n        log.Error(err)\n        return\n    }\n    defer sentryHook.Flush()\n    \n    log.AddHook(sentryHook)\n\n    err = fmt.Errorf(\"test error\")\n    log.WithError(err).Error(\"Dead beef\")\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonrik%2Flogrus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonrik%2Flogrus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonrik%2Flogrus/lists"}