{"id":29035962,"url":"https://github.com/tubitv/logger_sentry","last_synced_at":"2025-06-26T12:36:30.642Z","repository":{"id":44640787,"uuid":"102135973","full_name":"Tubitv/logger_sentry","owner":"Tubitv","description":"Elixir Logger backend for Sentry","archived":false,"fork":false,"pushed_at":"2025-05-16T08:55:49.000Z","size":77,"stargazers_count":26,"open_issues_count":1,"forks_count":9,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-06-13T05:18:24.392Z","etag":null,"topics":["elixir","logger","sentry"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tubitv.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,"zenodo":null}},"created_at":"2017-09-01T17:14:57.000Z","updated_at":"2025-05-16T08:54:47.000Z","dependencies_parsed_at":"2025-05-12T11:37:16.678Z","dependency_job_id":null,"html_url":"https://github.com/Tubitv/logger_sentry","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/Tubitv/logger_sentry","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tubitv%2Flogger_sentry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tubitv%2Flogger_sentry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tubitv%2Flogger_sentry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tubitv%2Flogger_sentry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tubitv","download_url":"https://codeload.github.com/Tubitv/logger_sentry/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tubitv%2Flogger_sentry/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262068861,"owners_count":23253879,"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":["elixir","logger","sentry"],"created_at":"2025-06-26T12:36:29.862Z","updated_at":"2025-06-26T12:36:30.623Z","avatar_url":"https://github.com/Tubitv.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LoggerSentry\n\n[![Build Status](https://img.shields.io/travis/Tubitv/logger_sentry.svg?style=flat-square)](https://travis-ci.org/Tubitv/logger_sentry)\n[![Module Version](https://img.shields.io/hexpm/v/logger_sentry.svg?style=flat-square)](https://hex.pm/packages/logger_sentry)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg?style=flat-square)](https://hexdocs.pm/logger_sentry/)\n[![Total Download](https://img.shields.io/hexpm/dt/logger_sentry.svg?style=flat-square)](https://hex.pm/packages/logger_sentry)\n[![License](https://img.shields.io/hexpm/l/logger_sentry.svg?style=flat-square)](https://github.com/Tubitv/logger_sentry/blob/master/LICENSE)\n[![Last Updated](https://img.shields.io/github/last-commit/Tubitv/logger_sentry.svg?style=flat-square)](https://github.com/Tubitv/logger_sentry/commits/master)\n\nThe `Logger` backend for [Sentry](https://sentry.io).\n\n## Installation\n\nThe package can be installed as:\n\nAdd `:logger_sentry` to your `mix.exs` file:\n\n```elixir\ndef deps do\n  [\n    {:logger_sentry, \"~\u003e 0.8.0\"}\n  ]\nend\n```\n\nConfigure your config file, just like:\n\n```elixir\nconfig :logger,\n  backends: [:console, Logger.Backends.Sentry],\n  sentry: [\n    level: :error,\n    metadata: [:application, :module, :function, :file, :line, :pid] # :all\n  ]\n```\n\nIf you want keep `:console` backend in Logger event server, you should set\n`:backends` with `[:console, Logger.Backends.Sentry]`. Just like `:console`\nbackend, the sentry backend supports the same `:level` and `:metadata` options.\n\n## Usage\n\nSimilar to `Logger`.\n\n```elixir\nLogger.debug(\"this is one debug message\")\nLogger.info(\"this is one info message\")\nLogger.warning(\"this is one warning message\")\n\n# if you set sentry logger level with `:error`, the message will sent to your\n# sentry server\nLogger.error(\"this is one error message\")\n```\n\n### Get log level\n\n```elixir\nLogger.Backends.Sentry.level\n```\n\n### Set log level\n\n```elixir\nLogger.Backends.Sentry.level(:error)\n```\n\n### Get metadata\n\n```elixir\nLogger.Backends.Sentry.metadata\n```\n\n### Set metadata\n\n```elixir\nLogger.Backends.Sentry.metadata([])\nLogger.Backends.Sentry.metadata(:all)\nLogger.Backends.Sentry.metadata([:application, :module, :pid])\n```\n\n## Fingerprints\n\nTo use fingerprints in sentry dashboard, set `:logger_sentry` option to define\ngenerate fingerprints modules:\n\n```elixir\nconfig :logger_sentry,\n  fingerprints_mods: [\n    LoggerSentry.Fingerprint.MatchMessage,\n    LoggerSentry.Fingerprint.CodeLocation,\n    MyApp.Fingerprint.MyModule\n  ]\n```\n\nOnly match error message, `LoggerSentry.Fingerprint.MatchMessage ` and code\nlocation, `LoggerSentry.Fingerprint.CodeLocation ` are available by default\nright now.\n\nYou can define your own module, for example, `MyApp.Fingerprint.MyModule`, by\nadding a `fingerprints/2` function.\n\n## Examples\n\nSee additional usage examples at [wiki](https://github.com/Tubitv/logger_sentry/wiki/Use-example).\n\n## Rate Limiting\n\nSentry can be configured with a rate limit on the Sentry servers.\nAny messages received faster than that limit will not be processed.\nIn order to avoid unnecessary traffic and potentially getting IP-blocked\nby Sentry, it is recommended to add rate limiting on your own servers.\n\nBy default, `LoggerSentry` does not enforce rate limits. Rate limiting can be added through your project config files like this:\n\n```\nimport Config\n\nconfig :logger_sentry, LoggerSentry.RateLimiter,\n    rate_limiter_module: LoggerSentry.RateLimiter.TokenBucket,\n    rate_limiter_options: [token_count: 20, interval_ms: 60_000]\n```\n\n`LoggerSentry` comes with a simple token bucket algorithm.\nYou may add other rate-limiting algorithms by creating a module that\nconforms to the `LoggerSentry.RateLimiter` module. Then setting\n`rate_limiter_module` to your custom module.\n\n## Copyright and License\n\nCopyright (c) 2017 Taotao Lin\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftubitv%2Flogger_sentry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftubitv%2Flogger_sentry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftubitv%2Flogger_sentry/lists"}