{"id":18937674,"url":"https://github.com/logflare/logflare_logger_backend","last_synced_at":"2025-07-21T06:32:23.892Z","repository":{"id":34977477,"uuid":"184315421","full_name":"Logflare/logflare_logger_backend","owner":"Logflare","description":"Logger backend to send Elixir logs to Logflare.","archived":false,"fork":false,"pushed_at":"2024-10-20T15:24:19.000Z","size":241,"stargazers_count":90,"open_issues_count":7,"forks_count":17,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-18T12:54:56.188Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","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/Logflare.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":"2019-04-30T18:54:23.000Z","updated_at":"2025-06-26T03:55:29.000Z","dependencies_parsed_at":"2024-10-20T21:08:25.243Z","dependency_job_id":null,"html_url":"https://github.com/Logflare/logflare_logger_backend","commit_stats":{"total_commits":288,"total_committers":12,"mean_commits":24.0,"dds":0.3472222222222222,"last_synced_commit":"bc8d7d3df3df943aa6a8dda87bf5bf64d664b4d3"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/Logflare/logflare_logger_backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Logflare%2Flogflare_logger_backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Logflare%2Flogflare_logger_backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Logflare%2Flogflare_logger_backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Logflare%2Flogflare_logger_backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Logflare","download_url":"https://codeload.github.com/Logflare/logflare_logger_backend/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Logflare%2Flogflare_logger_backend/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266253614,"owners_count":23900053,"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":[],"created_at":"2024-11-08T12:12:00.037Z","updated_at":"2025-07-21T06:32:23.875Z","avatar_url":"https://github.com/Logflare.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LogflareLogger\n\nAn Elixir Logger backend for [Logflare](https://github.com/Logflare/logflare). Streams logs to the [Logflare.app](https://logflare.app) API.\n\n# Configuration\n\nGet your `api_key` and create a `source` at [logflare.app](https://logflare.app/dashboard)\n\nYou will need a Logflare source **source_id** which you can copy from your dashboard after you create a one.\n\n```elixir\nconfig :logger,\n  level: :info, # or other Logger level\n  backends: [LogflareLogger.HttpBackend]\n\nconfig :logflare_logger_backend,\n  url: \"https://api.logflare.app\", # https://api.logflare.app is configured by default and you can set your own url\n  level: :info, # Default LogflareLogger level is :info. Note that log messages are filtered by the :logger application first\n  api_key: \"...\", # your Logflare API key, found on your dashboard\n  source_id: \"...\", # the Logflare source UUID, found  on your Logflare dashboard\n  flush_interval: 1_000, # minimum time in ms before a log batch is sent\n  max_batch_size: 50, # maximum number of events before a log batch is sent\n  metadata: :all # optionally you can drop keys if they exist with `metadata: [drop: [:list, :keys, :to, :drop]]`\n```\n\nAlternatively, you can configure these options in your system environment. Prefix the above option names with `LOGFLARE_`.\n\n```bash\nexport LOGFLARE_URL=\"https://api.logflare.app\"\nexport LOGFLARE_API_KEY=\"...\"\nexport LOGFLARE_SOURCE_ID=\"...\"\n```\n\n## Usage\n\nAfter configuring LogflareLogger in `config.exs`, use `Logger.info, Logger.error, ...` functions to send log events to Logflare app.\n\n## Usage with context\n\n`LogflareLogger.context` function signatures follows the one of `Logger.metadata` with slight modifications to parameters and return values.\n\n```elixir\n# Merges map or keyword with existing context, will overwrite values.\nLogflareLogger.context(%{user: %{id: 3735928559}})\nLogflareLogger.context(user: %{id: 3735928559})\n\n# Get all context entries or a value for a specific key\nLogflareLogger.context(:user)\nLogflareLogger.context()\n\n# Deletes all context entries or specific context key/value\nLogflareLogger.context(user: nil)\nLogflareLogger.reset_context()\n```\n\n## Current limitations\n\nLogflare log event BigQuery table schema is auto-generated per source. If you send a log with `Logger.info(\"first\", user: %{id: 1})`, Logflare will generate a metadata field of type integer. If in the future, you'll send a log event to the same source using `Logger.info(\"first\", user: %{id: \"d9c2feff-d38a-4671-8de4-a1e7f7dd7e3c\"1})`, the log with a binary id will be rejected.\n\nLogflareLogger log payloads sent to Logflare API are encoded using [BERT](http://bert-rpc.org).\n\nAt this moment LogflareLogger doesn't support full one-to-one logging of Elixir types and applies the following conversions:\n\n- atoms converted to strings\n- charlists are converted to strings\n- tuples converted to arrays\n- keyword lists converted to maps\n- structs converted to maps\n- NaiveDateTime and DateTime are converted using the `String.Chars` protocol\n- pids are converted to strings\n\nLogflareLogger doesn't support:\n\n- non-binary messages, e.g. `Logger.info(%{user_count: 1337})`\n\n## Exceptions\n\nLogflareLogger automatically logs all exceptions and formats stacktraces.\n\n## Troubleshooting\n\nRun `mix logflare_logger.verify_config` to test your config.\n\nEmail \u003csupport@logflare.app\u003e for help!\n\n## Installation\n\nIf [available in Hex](https://hex.pm/docs/publish), the package can be installed\nby adding `logflare_logger_backend` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:logflare_logger_backend, \"~\u003e 0.11.4\"}\n  ]\nend\n```\n\nDocumentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)\nand published on [HexDocs](https://hexdocs.pm). Once published, the docs can\nbe found at [https://hexdocs.pm/logflare_logger_backend](https://hexdocs.pm/logflare_logger_backend).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogflare%2Flogflare_logger_backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flogflare%2Flogflare_logger_backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogflare%2Flogflare_logger_backend/lists"}