{"id":46679674,"url":"https://github.com/kimbo/directmailers-loghook","last_synced_at":"2026-03-08T23:38:32.439Z","repository":{"id":57565843,"uuid":"337988160","full_name":"kimbo/directmailers-loghook","owner":"kimbo","description":"logrus hook to send yourself (and others) postcards with your logs on them","archived":false,"fork":false,"pushed_at":"2021-02-12T05:59:23.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-06-20T09:23:44.820Z","etag":null,"topics":["go","golang","letters","logging","logrus","logrus-hook","mail","postcard"],"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/kimbo.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":"2021-02-11T09:53:23.000Z","updated_at":"2024-06-20T09:23:44.821Z","dependencies_parsed_at":"2022-09-09T16:52:50.560Z","dependency_job_id":null,"html_url":"https://github.com/kimbo/directmailers-loghook","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kimbo/directmailers-loghook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimbo%2Fdirectmailers-loghook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimbo%2Fdirectmailers-loghook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimbo%2Fdirectmailers-loghook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimbo%2Fdirectmailers-loghook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kimbo","download_url":"https://codeload.github.com/kimbo/directmailers-loghook/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimbo%2Fdirectmailers-loghook/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30277185,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T20:45:49.896Z","status":"ssl_error","status_checked_at":"2026-03-08T20:45:49.525Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["go","golang","letters","logging","logrus","logrus-hook","mail","postcard"],"created_at":"2026-03-08T23:38:31.888Z","updated_at":"2026-03-08T23:38:32.425Z","avatar_url":"https://github.com/kimbo.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# directmailers-loghook for logrus\n\nHave you ever wanted to get a postcard in the mail the last time your program crashed?\n\nThis is a hook for [logrus](https://github.com/sirupsen/logrus) that will send your logs to you (or some other address of your choosing) in a letter or post card in the mail.\n\n# Requirements\n\nAs the name suggests, this library uses the directmailers API for sending letters and postcards.\nSo you'll need an account with them.\nSigning up is free, and they'll give you $10 in credit when you do, which should be enough to send about 17 postcards (see https://print.directmailers.com/tour/pricing/).\n\n# Installation and usage\n\n```\ngo get github.com/kimbo/directmailers-loghook/...\n```\n\nThen you can initialize the hook like this:\n\n```go\npackage main\n\nimport (\n\t\"errors\"\n\t\"os\"\n\n\t\"github.com/kimbo/directmailers-loghook/api\"\n\t\"github.com/kimbo/directmailers-loghook/hook\"\n\t\"github.com/sirupsen/logrus\"\n)\n\nfunc main() {\n    // get these at https://dashboard.directmailers.com/settings\n\tuser := os.Getenv(\"DIRECTMAILER_USERNAME\")\n\tpass := os.Getenv(\"DIRECTMAILER_PASSWORD\")\n\n\th := hook.New(user, pass, hook.Config{\n\t\tDryRun: true,\n\t\tMaxLevel: logrus.ErrorLevel,\n\t\tMailType: hook.Postcard, // or hook.Letter\n\t\tFrom: api.SenderDetails{\n\t\t\tName:         \"my-application\",\n\t\t\tAddressLine1: \"123 N 456 W\",\n\t\t\tAddressLine2: \"Apt 789\",\n\t\t\tCity:         \"San Francisco\",\n\t\t\tState:        \"CA\",\n\t\t\tZip:          \"12345\",\n\t\t},\n\t\tTo: api.RecipientDetails{\n\t\t\tName:         \"The White House\", // why not send you logs to the President?\n\t\t\tAddressLine1: \"1600 Pennsylvania Ave\",\n\t\t\tAddressLine2: \"\",\n\t\t\tCity:         \"Washington\",\n\t\t\tState:        \"DC\",\n\t\t\tZip:          \"20006\",\n\t\t},\n\t})\n\tlogrus.AddHook(h)\n\n\tdoSomething := func() error {\n\t\treturn errors.New(\"I was running and tripped over the waste basket and now there's garbage everywhere\")\n\t}\n\n\tif err := doSomething(); err != nil {\n\t\t// that's another $0.56, errors get expensive quickly\n\t\tlogrus.Errorf(\"Oh no, we have a problem: %v\", err)\n\t}\n}\n```\n\n# Roadmap\n\n- Improve default template for letters and postcards (right now it's just `\u003cp\u003elog message goes here\u003c/p\u003e`)\n- Clean way to use custom templates\n\n# Limitations\n\nI don't know this for sure, but I suspect directmailers only will send mail in the United States of America.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkimbo%2Fdirectmailers-loghook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkimbo%2Fdirectmailers-loghook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkimbo%2Fdirectmailers-loghook/lists"}