{"id":13830351,"url":"https://github.com/samber/slog-microsoft-teams","last_synced_at":"2026-06-18T17:31:32.499Z","repository":{"id":159389521,"uuid":"634623562","full_name":"samber/slog-microsoft-teams","owner":"samber","description":"🚨 slog: Microsoft Teams handler","archived":false,"fork":false,"pushed_at":"2026-03-25T15:03:57.000Z","size":104,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-26T17:16:21.753Z","etag":null,"topics":["attribute","error","go","golang","handler","log","log-level","logger","microsoft","microsoft-teams","middleware","slog","structured-logging","teams"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/samber/slog-microsoft-teams/v2","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/samber.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["samber"]}},"created_at":"2023-04-30T18:16:40.000Z","updated_at":"2026-03-25T14:38:59.000Z","dependencies_parsed_at":"2023-10-21T21:45:06.160Z","dependency_job_id":"3cb0f812-110b-4cfb-917a-21bf6f71fb21","html_url":"https://github.com/samber/slog-microsoft-teams","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/samber/slog-microsoft-teams","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samber%2Fslog-microsoft-teams","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samber%2Fslog-microsoft-teams/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samber%2Fslog-microsoft-teams/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samber%2Fslog-microsoft-teams/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samber","download_url":"https://codeload.github.com/samber/slog-microsoft-teams/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samber%2Fslog-microsoft-teams/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34501472,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-18T02:00:06.871Z","response_time":128,"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":["attribute","error","go","golang","handler","log","log-level","logger","microsoft","microsoft-teams","middleware","slog","structured-logging","teams"],"created_at":"2024-08-04T10:00:58.942Z","updated_at":"2026-06-18T17:31:32.494Z","avatar_url":"https://github.com/samber.png","language":"Go","funding_links":["https://github.com/sponsors/samber"],"categories":["Log forwarding"],"sub_categories":[],"readme":"\n# slog: Microsoft Teams handler\n\n[![tag](https://img.shields.io/github/tag/samber/slog-microsoft-teams.svg)](https://github.com/samber/slog-microsoft-teams/releases)\n![Go Version](https://img.shields.io/badge/Go-%3E%3D%201.21-%23007d9c)\n[![GoDoc](https://godoc.org/github.com/samber/slog-microsoft-teams?status.svg)](https://pkg.go.dev/github.com/samber/slog-microsoft-teams)\n![Build Status](https://github.com/samber/slog-microsoft-teams/actions/workflows/test.yml/badge.svg)\n[![Go report](https://goreportcard.com/badge/github.com/samber/slog-microsoft-teams)](https://goreportcard.com/report/github.com/samber/slog-microsoft-teams)\n[![Coverage](https://img.shields.io/codecov/c/github/samber/slog-microsoft-teams)](https://codecov.io/gh/samber/slog-microsoft-teams)\n[![Contributors](https://img.shields.io/github/contributors/samber/slog-microsoft-teams)](https://github.com/samber/slog-microsoft-teams/graphs/contributors)\n[![License](https://img.shields.io/github/license/samber/slog-microsoft-teams)](./LICENSE)\n\nA [Teams](https://www.microsoft.com/en/microsoft-teams) Handler for [slog](https://pkg.go.dev/log/slog) Go library.\n\n\u003cdiv align=\"center\"\u003e\n  \u003chr\u003e\n  \u003csup\u003e\u003cb\u003eSponsored by:\u003c/b\u003e\u003c/sup\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://cast.ai/samuel\"\u003e\n    \u003cdiv\u003e\n      \u003cimg src=\"https://github.com/user-attachments/assets/502f8fa8-e7e8-4754-a51f-036d0443e694\" width=\"200\" alt=\"Cast AI\"\u003e\n    \u003c/div\u003e\n    \u003cdiv\u003e\n      Cut Kubernetes \u0026 AI costs, boost application stability\n    \u003c/div\u003e\n  \u003c/a\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://www.dash0.com?utm_campaign=148395251-samber%20github%20sponsorship\u0026utm_source=github\u0026utm_medium=sponsorship\u0026utm_content=samber\"\u003e\n    \u003cdiv\u003e\n      \u003cimg src=\"https://github.com/user-attachments/assets/b1f2e876-0954-4dc3-824d-935d29ba8f3f\" width=\"200\" alt=\"Dash0\"\u003e\n    \u003c/div\u003e\n    \u003cdiv\u003e\n      100% OpenTelemetry-native observability platform\u003cbr\u003eSimple to use, built on open standards, and designed for full cost control\n    \u003c/div\u003e\n  \u003c/a\u003e\n  \u003chr\u003e\n\u003c/div\u003e\n\n**See also:**\n\n- [slog-multi](https://github.com/samber/slog-multi): `slog.Handler` chaining, fanout, routing, failover, load balancing...\n- [slog-formatter](https://github.com/samber/slog-formatter): `slog` attribute formatting\n- [slog-sampling](https://github.com/samber/slog-sampling): `slog` sampling policy\n- [slog-mock](https://github.com/samber/slog-mock): `slog.Handler` for test purposes\n\n**HTTP middlewares:**\n\n- [slog-gin](https://github.com/samber/slog-gin): Gin middleware for `slog` logger\n- [slog-echo](https://github.com/samber/slog-echo): Echo middleware for `slog` logger\n- [slog-fiber](https://github.com/samber/slog-fiber): Fiber middleware for `slog` logger\n- [slog-chi](https://github.com/samber/slog-chi): Chi middleware for `slog` logger\n- [slog-http](https://github.com/samber/slog-http): `net/http` middleware for `slog` logger\n\n**Loggers:**\n\n- [slog-zap](https://github.com/samber/slog-zap): A `slog` handler for `Zap`\n- [slog-zerolog](https://github.com/samber/slog-zerolog): A `slog` handler for `Zerolog`\n- [slog-logrus](https://github.com/samber/slog-logrus): A `slog` handler for `Logrus`\n\n**Log sinks:**\n\n- [slog-datadog](https://github.com/samber/slog-datadog): A `slog` handler for `Datadog`\n- [slog-betterstack](https://github.com/samber/slog-betterstack): A `slog` handler for `Betterstack`\n- [slog-rollbar](https://github.com/samber/slog-rollbar): A `slog` handler for `Rollbar`\n- [slog-loki](https://github.com/samber/slog-loki): A `slog` handler for `Loki`\n- [slog-sentry](https://github.com/samber/slog-sentry): A `slog` handler for `Sentry`\n- [slog-syslog](https://github.com/samber/slog-syslog): A `slog` handler for `Syslog`\n- [slog-logstash](https://github.com/samber/slog-logstash): A `slog` handler for `Logstash`\n- [slog-fluentd](https://github.com/samber/slog-fluentd): A `slog` handler for `Fluentd`\n- [slog-graylog](https://github.com/samber/slog-graylog): A `slog` handler for `Graylog`\n- [slog-quickwit](https://github.com/samber/slog-quickwit): A `slog` handler for `Quickwit`\n- [slog-slack](https://github.com/samber/slog-slack): A `slog` handler for `Slack`\n- [slog-telegram](https://github.com/samber/slog-telegram): A `slog` handler for `Telegram`\n- [slog-mattermost](https://github.com/samber/slog-mattermost): A `slog` handler for `Mattermost`\n- [slog-microsoft-teams](https://github.com/samber/slog-microsoft-teams): A `slog` handler for `Microsoft Teams`\n- [slog-webhook](https://github.com/samber/slog-webhook): A `slog` handler for `Webhook`\n- [slog-kafka](https://github.com/samber/slog-kafka): A `slog` handler for `Kafka`\n- [slog-nats](https://github.com/samber/slog-nats): A `slog` handler for `NATS`\n- [slog-parquet](https://github.com/samber/slog-parquet): A `slog` handler for `Parquet` + `Object Storage`\n- [slog-channel](https://github.com/samber/slog-channel): A `slog` handler for Go channels\n\n## 🚀 Install\n\n```sh\ngo get github.com/samber/slog-microsoft-teams/v2\n```\n\n**Compatibility**: go \u003e= 1.21\n\nNo breaking changes will be made to exported APIs before v3.0.0.\n\n## 💡 Usage\n\nGoDoc: [https://pkg.go.dev/github.com/samber/slog-microsoft-teams/v2](https://pkg.go.dev/github.com/samber/slog-microsoft-teams/v2)\n\n### Handler options\n\n```go\ntype Option struct {\n\t// log level (default: debug)\n\tLevel slog.Leveler\n\n\t// Teams webhook url\n\tWebhookURL string\n\tTimeout    time.Duration // default: 10s\n\n\t// optional: customize Teams event builder\n\tConverter Converter\n\n\t// optional: see slog.HandlerOptions\n\tAddSource   bool\n\tReplaceAttr func(groups []string, a slog.Attr) slog.Attr\n}\n```\n\nOther global parameters:\n\n```go\nslogmicrosoftteams.SourceKey = \"source\"\nslogmicrosoftteams.ColorMapping = map[slog.Level]string{...}\n```\n\n### Example\n\n```go\nimport (\n\tslogmicrosoftteams \"github.com/samber/slog-microsoft-teams/v2\"\n\t\"log/slog\"\n)\n\nfunc main() {\n\turl := \"https://xxxxxx.webhook.office.com/webhookb2/xxxxx@xxxxx/IncomingWebhook/xxxxx/xxxxx\"\n\n\tlogger := slog.New(slogmicrosoftteams.Option{Level: slog.LevelDebug, WebhookURL: url}.NewMicrosoftTeamsHandler())\n\tlogger = logger.With(\"release\", \"v1.0.0\")\n\n\tlogger.\n\t\tWith(\n\t\t\tslog.Group(\"user\",\n\t\t\t\tslog.String(\"id\", \"user-123\"),\n\t\t\t\tslog.Time(\"created_at\", time.Now().AddDate(0, 0, -1)),\n\t\t\t),\n\t\t).\n\t\tWith(\"environment\", \"dev\").\n\t\tWith(\"error\", fmt.Errorf(\"an error\")).\n\t\tError(\"A message\")\n}\n\n```\n\n## 🤝 Contributing\n\n- Ping me on twitter [@samuelberthe](https://twitter.com/samuelberthe) (DMs, mentions, whatever :))\n- Fork the [project](https://github.com/samber/slog-microsoft-teams)\n- Fix [open issues](https://github.com/samber/slog-microsoft-teams/issues) or request new features\n\nDon't hesitate ;)\n\n```bash\n# Install some dev dependencies\nmake tools\n\n# Run tests\nmake test\n# or\nmake watch-test\n```\n\n## 👤 Contributors\n\n![Contributors](https://contrib.rocks/image?repo=samber/slog-microsoft-teams)\n\n## 💫 Show your support\n\nGive a ⭐️ if this project helped you!\n\n[![GitHub Sponsors](https://img.shields.io/github/sponsors/samber?style=for-the-badge)](https://github.com/sponsors/samber)\n\n## 📝 License\n\nCopyright © 2023 [Samuel Berthe](https://github.com/samber).\n\nThis project is [MIT](./LICENSE) licensed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamber%2Fslog-microsoft-teams","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamber%2Fslog-microsoft-teams","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamber%2Fslog-microsoft-teams/lists"}