{"id":16934763,"url":"https://github.com/shogo82148/logrus-slog-hook","last_synced_at":"2025-03-21T04:23:01.997Z","repository":{"id":193448686,"uuid":"688794744","full_name":"shogo82148/logrus-slog-hook","owner":"shogo82148","description":"log/slog hook for logrus.","archived":false,"fork":false,"pushed_at":"2023-09-10T14:34:01.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-15T21:17:22.749Z","etag":null,"topics":["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/shogo82148.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":"2023-09-08T05:57:42.000Z","updated_at":"2023-09-11T01:01:27.000Z","dependencies_parsed_at":"2023-09-08T08:28:17.957Z","dependency_job_id":"422bf8b7-cb20-4947-a3b5-61753d757634","html_url":"https://github.com/shogo82148/logrus-slog-hook","commit_stats":null,"previous_names":["shogo82148/logrus-slog-hook"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shogo82148%2Flogrus-slog-hook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shogo82148%2Flogrus-slog-hook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shogo82148%2Flogrus-slog-hook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shogo82148%2Flogrus-slog-hook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shogo82148","download_url":"https://codeload.github.com/shogo82148/logrus-slog-hook/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244734646,"owners_count":20501111,"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":["golang","logging","logrus"],"created_at":"2024-10-13T20:52:55.421Z","updated_at":"2025-03-21T04:23:01.975Z","avatar_url":"https://github.com/shogo82148.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# logrus-slog-formatter\n\nlogrus-slog-formatter is [log/slog](https://pkg.go.dev/log/slog) hook for [logrus](https://github.com/sirupsen/logrus).\n\n## SYNOPSIS\n\n```go\npackage main\n\nimport (\n\t\"io\"\n\t\"log/slog\"\n\t\"os\"\n\n\tsloghook \"github.com/shogo82148/logrus-slog-hook\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nfunc main() {\n\th := slog.NewTextHandler(os.Stderr, nil)\n\tlogrus.AddHook(sloghook.New(h))\n\n\t// logrus-slog-hook outputs the logs into STDERR.\n\t// I recommend that disable the default output.\n\tlogrus.SetFormatter(sloghook.NewFormatter())\n\tlogrus.SetOutput(io.Discard)\n\n\tlogrus.WithFields(logrus.Fields{\n\t\t\"name\": \"joe\",\n\t\t\"age\":  42,\n\t}).Error(\"Hello world!\")\n\n\t// Output:\n\t// time=2023-09-10T23:32:41.229+09:00 level=ERROR msg=\"Hello world!\" age=42 name=joe\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshogo82148%2Flogrus-slog-hook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshogo82148%2Flogrus-slog-hook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshogo82148%2Flogrus-slog-hook/lists"}