{"id":32172924,"url":"https://github.com/localvore-today/secure_log_formatter","last_synced_at":"2026-02-19T08:03:12.503Z","repository":{"id":57546503,"uuid":"89981913","full_name":"localvore-today/secure_log_formatter","owner":"localvore-today","description":"Secure log formatting for Elixir","archived":false,"fork":false,"pushed_at":"2017-07-18T06:42:12.000Z","size":11,"stargazers_count":10,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-21T18:46:36.109Z","etag":null,"topics":["elixir","formatting","logging","secure-logging"],"latest_commit_sha":null,"homepage":"","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/localvore-today.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":"2017-05-02T02:13:31.000Z","updated_at":"2023-09-10T08:49:34.000Z","dependencies_parsed_at":"2022-09-05T12:31:11.200Z","dependency_job_id":null,"html_url":"https://github.com/localvore-today/secure_log_formatter","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/localvore-today/secure_log_formatter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localvore-today%2Fsecure_log_formatter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localvore-today%2Fsecure_log_formatter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localvore-today%2Fsecure_log_formatter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localvore-today%2Fsecure_log_formatter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/localvore-today","download_url":"https://codeload.github.com/localvore-today/secure_log_formatter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localvore-today%2Fsecure_log_formatter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29608152,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T06:47:36.664Z","status":"ssl_error","status_checked_at":"2026-02-19T06:45:47.551Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["elixir","formatting","logging","secure-logging"],"created_at":"2025-10-21T18:46:36.250Z","updated_at":"2026-02-19T08:03:12.498Z","avatar_url":"https://github.com/localvore-today.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SecureLogFormatter [![Build Status](https://travis-ci.org/localvore-today/secure_log_formatter.svg?branch=master)](https://travis-ci.org/localvore-today/secure_log_formatter)\n\nA secure formatter for Elixir Logger and replacement for `Kernel.inspect/1`.  Using blacklisted keys and patterns `SecureLogFormatter` will identify and redact sensitive information from logs with ease.\n\n\n## Installation\n\n```elixir\ndef deps do\n  [{:secure_log_formatter, \"~\u003e 1.0\"}]\nend\n```\n\nLike living on the edge?  Want the latest and greatest?\n\n```elixir\ndef deps do\n  [{:secure_log_formatter,\n  \tgithub: \"localvore-today/secure_log_formatter\"}]\nend\n```\n\n## Usage\n\n```elixir\nconfig :logger,\n  secure_log_formatter:\n    [\n      # Map and Keyword List keys who's value should be hidden\n      fields: [\"password\", \"credit_card\", ~r/.*_token/],\n\n      # Patterns which if found, should be hidden\n      patterns: [~r/4[0-9]{15}/], # Simple credit card example\n\n      # defaults to \"[REDACTED]\"\n      replacement: \"[PRIVATE]\"\n    ]\n```\n\n#### Log formatting\n\nUsing `SecureLogFormatter` is easy, we only need to pass a tuple to the `:format` option for our logging backend(s):\n\n```elixir\nconfig :logger,\n  console: [format: {SecureLogFormatter, :format}]\n```\n\nIf we give it awhirl:\n\n```elixir\niex\u003e Logger.info(\"Customer Credit Card: 4111111111111111\")\n15:39:40.169 [info]  Customer Credit Card: [PRIVATE]\n```\n\n#### Replacing `inspect/1`\n\nTo leverage `SecureLogFormatter.inspect/1` in place of `Kernel.inspect/1` we can add two lines to the top of our files:\n\n```elixir\nimport Kernel, except: [inspect: 1]\nimport SecureLogFormatter, only: [inspect: 1]\n```\n\nWith this change calls to `inspect/1` will be handled by `SecureLogFormatter`:\n\n```elixir\niex\u003e inspect(%{access_token: \"secret_token\", password: \"abc123\", username: \"doomspork\"})\n\"%{access_token: \\\"[PRIVATE]\\\", password: \\\"[PRIVATE]\\\", username: \\\"doomspork\\\"}\"\n```\n\n## License\n\nSecureLogFormatter source code is released under MIT.\n\nSee [LICENSE](LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocalvore-today%2Fsecure_log_formatter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flocalvore-today%2Fsecure_log_formatter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocalvore-today%2Fsecure_log_formatter/lists"}