{"id":23507354,"url":"https://github.com/simplyhexagonal/logger-transport-discord","last_synced_at":"2025-09-01T08:13:47.293Z","repository":{"id":71910298,"uuid":"417580383","full_name":"simplyhexagonal/logger-transport-discord","owner":"simplyhexagonal","description":"This is a transport which allows @simplyhexagonal/logger to use Discord as a communication channel","archived":false,"fork":false,"pushed_at":"2022-01-16T03:14:41.000Z","size":944,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-18T12:36:44.857Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/simplyhexagonal.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2021-10-15T17:19:01.000Z","updated_at":"2022-01-11T03:11:33.000Z","dependencies_parsed_at":"2023-09-24T03:32:16.824Z","dependency_job_id":"88b546f8-c8f7-4505-99c2-7310190bdf09","html_url":"https://github.com/simplyhexagonal/logger-transport-discord","commit_stats":{"total_commits":45,"total_committers":1,"mean_commits":45.0,"dds":0.0,"last_synced_commit":"04fe61c2122ea6943f333ac51bc536c009c3c6c1"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/simplyhexagonal/logger-transport-discord","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplyhexagonal%2Flogger-transport-discord","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplyhexagonal%2Flogger-transport-discord/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplyhexagonal%2Flogger-transport-discord/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplyhexagonal%2Flogger-transport-discord/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simplyhexagonal","download_url":"https://codeload.github.com/simplyhexagonal/logger-transport-discord/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simplyhexagonal%2Flogger-transport-discord/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273094091,"owners_count":25044439,"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","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-12-25T10:18:13.983Z","updated_at":"2025-09-01T08:13:47.271Z","avatar_url":"https://github.com/simplyhexagonal.png","language":"TypeScript","funding_links":["https://www.buymeacoffee.com/jeanlescure","https://opencollective.com/simplyhexagonal"],"categories":[],"sub_categories":[],"readme":"# Discord transport for Simply Hexagonal Logger\n![Tests](https://github.com/simplyhexagonal/logger-transport-discord/workflows/tests/badge.svg)\n[![Try logger on RunKit](https://badge.runkitcdn.com/@simplyhexagonal/logger.svg)](https://npm.runkit.com/@simplyhexagonal/logger)\n\nThis is a transport which allows [@simplyhexagonal/logger](https://github.com/simplyhexagonal/logger) to use Discord as a communication channel.\n\n![image depicting four automated messages sent by simplyhexagonal/logger and received by discord](https://raw.githubusercontent.com/simplyhexagonal/logger-transport-discord/main/assets/logger-transport-discord-output-example-1.png)\n\n## Open source notice\n\nThis project is open to updates by its users, [I](https://github.com/jeanlescure) ensure that PRs are relevant to the community.\nIn other words, if you find a bug or want a new feature, please help us by becoming one of the\n[contributors](#contributors-) ✌️ ! See the [contributing section](#contributing)\n\n## Like this module? ❤\n\nPlease consider:\n\n- [Buying me a coffee](https://www.buymeacoffee.com/jeanlescure) ☕\n- Supporting Simply Hexagonal on [Open Collective](https://opencollective.com/simplyhexagonal) 🏆\n- Starring this repo on [Github](https://github.com/simplyhexagonal/logger-transport-discord) 🌟\n\n## Usage\n\n```ts\nrequire('dotenv').config();\n\nimport os from 'os';\n\nimport Logger, {\n  LoggerTransportName,\n  LoggerTransportResult,\n} from '@simplyhexagonal/logger';\nimport DiscordTransport from '@simplyhexagonal/logger-transport-discord';\n\nconst discordDefault = {\n  transport: LoggerTransportName.DISCORD,\n  options: {\n    destination: (process.env.DISCORD_WEBHOOK || ''),\n  },\n};\n\nconst discordError = {\n  transport: LoggerTransportName.DISCORD,\n  options: {\n    destination: (process.env.DISCORD_ERROR_WEBHOOK || ''),\n  },\n};\n\nconst logger = new Logger({\n  optionsByLevel: {\n    warn: [discordDefault],\n    info: [discordDefault],\n    debug: [discordDefault],\n    error: [discordError],\n    fatal: [discordError],\n    all: [discordDefault],\n    raw: [discordDefault],\n  },\n  singleton: false,\n  transports: {\n    [`${LoggerTransportName.DISCORD}`]: DiscordTransport,\n  },\n  appIdentifiers: {\n    region: 'us-east-1',\n    clusterType: 'KUBERNETES',\n    cluster: 'MyCluster',\n    hostname: os.hostname(),\n    app: 'my-app',\n  },\n  catchTransportErrors: true,\n});\n```\n\nFor more info about configuration options go to [@simplyhexagonal/logger on Github](https://github.com/simplyhexagonal/logger).\n\n## Discord Max Character Count\n\nCurrently Discord's Webhook API caps the content length at 2000 characters.\n\nIf your log content with a higher character count, this transport splits the message in two, sending\nfirst the app identity, timestamp and log level, then sending the message contents as a plain-text\nattachment. Similar to pasting a large message on Discord and selecting to send a file instead.\n\n![image depicting an automated message containing a long error JSON that was sent as a file](https://raw.githubusercontent.com/simplyhexagonal/logger-transport-discord/main/assets/logger-transport-discord-file-output-example.png)\n\n## Contributing\n\nYes, thank you! This plugin is community-driven, most of its features are from different authors.\nPlease update the docs and tests and add your name to the `package.json` file.\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://jeanlescure.cr\"\u003e\u003cimg src=\"https://avatars2.githubusercontent.com/u/3330339?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJean Lescure\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#maintenance-jeanlescure\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e \u003ca href=\"https://github.com/simplyhexagonal/logger-transport-discord/commits?author=jeanlescure\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#userTesting-jeanlescure\" title=\"User Testing\"\u003e📓\u003c/a\u003e \u003ca href=\"https://github.com/simplyhexagonal/logger-transport-discord/commits?author=jeanlescure\" title=\"Tests\"\u003e⚠️\u003c/a\u003e \u003ca href=\"#example-jeanlescure\" title=\"Examples\"\u003e💡\u003c/a\u003e \u003ca href=\"https://github.com/simplyhexagonal/logger-transport-discord/commits?author=jeanlescure\" title=\"Documentation\"\u003e📖\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/2huBrulee\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/29010617?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eAlejandro Merino\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#maintenance-2huBrulee\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e \u003ca href=\"https://github.com/simplyhexagonal/logger-transport-discord/commits?author=2huBrulee\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#userTesting-2huBrulee\" title=\"User Testing\"\u003e📓\u003c/a\u003e \u003ca href=\"https://github.com/simplyhexagonal/logger-transport-discord/commits?author=2huBrulee\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-enable --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n## License\n\nCopyright (c) 2021-Present [Logger Contributors](https://github.com/simplyhexagonal/logger-transport-discord/#contributors-).\u003cbr/\u003e\nLicensed under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplyhexagonal%2Flogger-transport-discord","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimplyhexagonal%2Flogger-transport-discord","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimplyhexagonal%2Flogger-transport-discord/lists"}