{"id":13878403,"url":"https://github.com/ankane/logstop","last_synced_at":"2025-11-17T14:02:17.573Z","repository":{"id":45880117,"uuid":"127575838","full_name":"ankane/logstop","owner":"ankane","description":"Keep personal data out of your logs","archived":false,"fork":false,"pushed_at":"2024-12-29T22:42:39.000Z","size":65,"stargazers_count":255,"open_issues_count":1,"forks_count":14,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-06T15:04:09.862Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/ankane.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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":"2018-03-31T22:20:23.000Z","updated_at":"2025-03-05T22:39:27.000Z","dependencies_parsed_at":"2023-12-26T20:42:15.097Z","dependency_job_id":"317c883a-d925-41c6-a59f-5a0ceab057f3","html_url":"https://github.com/ankane/logstop","commit_stats":{"total_commits":110,"total_committers":7,"mean_commits":"15.714285714285714","dds":0.6454545454545455,"last_synced_commit":"2cb97f9ca7935a4441e6fbc4a349d6f348ebd75c"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankane%2Flogstop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankane%2Flogstop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankane%2Flogstop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ankane%2Flogstop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ankane","download_url":"https://codeload.github.com/ankane/logstop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248753380,"owners_count":21156265,"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-08-06T08:01:48.613Z","updated_at":"2025-11-17T14:02:12.544Z","avatar_url":"https://github.com/ankane.png","language":"Ruby","funding_links":[],"categories":["Ruby","Logging"],"sub_categories":[],"readme":"# Logstop\n\n:fire: Keep personal data out of your logs\n\n```ruby\nlogger.info \"Hi test@example.org!\"\n# =\u003e Hi [FILTERED]!\n```\n\nBy default, scrubs:\n\n- email addresses\n- phone numbers\n- credit card numbers\n- Social Security numbers (SSNs)\n- passwords in URLs\n\nWorks with all types of logging - Ruby, Active Record, Active Job, and more\n\n```\nUser Load (0.1ms)  SELECT \"users\".* FROM \"users\" WHERE \"users\".\"email\" = ?  [[\"email\", \"[FILTERED]\"]]\n```\n\nWorks even when sensitive data is URL-encoded with plus encoding\n\n[![Build Status](https://github.com/ankane/logstop/actions/workflows/build.yml/badge.svg)](https://github.com/ankane/logstop/actions)\n\n## Installation\n\nAdd this line to your application’s Gemfile:\n\n```ruby\ngem \"logstop\"\n```\n\nAnd add it to your logger:\n\n```ruby\nLogstop.guard(logger)\n```\n\n### Rails\n\nCreate `config/initializers/logstop.rb` with:\n\n```ruby\nLogstop.guard(Rails.logger)\n```\n\n## Options\n\nTo scrub IP addresses (IPv4), use:\n\n```ruby\nLogstop.guard(logger, ip: true)\n```\n\nTo scrub MAC addresses, use:\n\n```ruby\nLogstop.guard(logger, mac: true)\n```\n\nAdd custom rules with:\n\n```ruby\nscrubber = lambda do |msg|\n  msg.gsub(/custom_regexp/, \"[FILTERED]\".freeze)\nend\n\nLogstop.guard(logger, scrubber: scrubber)\n```\n\nDisable default rules with:\n\n```ruby\nLogstop.guard(logger,\n  email: false,\n  phone: false,\n  credit_card: false,\n  ssn: false,\n  url_password: false\n)\n```\n\nTo scrub outside of logging, use:\n\n```ruby\nLogstop.scrub(msg)\n```\n\nIt supports the same options as `guard`.\n\n## Notes\n\nThis should be used in addition to `config.filter_parameters`, not as a replacement.\n\nLearn more about [securing sensitive data in Rails](https://ankane.org/sensitive-data-rails).\n\nAlso:\n\n- To scrub existing log files, check out [scrubadub](https://github.com/datascopeanalytics/scrubadub)\n- To anonymize IP addresses, check out [IP Anonymizer](https://github.com/ankane/ip_anonymizer)\n- To scan for unencrypted personal data in your database, check out [pdscan](https://github.com/ankane/pdscan)\n\n## Resources\n\n- [List of PII, as defined by NIST](https://en.wikipedia.org/wiki/Personally_identifiable_information#NIST_definition)\n\n## History\n\nView the [changelog](CHANGELOG.md)\n\n## Contributing\n\nEveryone is encouraged to help improve this project. Here are a few ways you can help:\n\n- [Report bugs](https://github.com/ankane/logstop/issues)\n- Fix bugs and [submit pull requests](https://github.com/ankane/logstop/pulls)\n- Write, clarify, or fix documentation\n- Suggest or add new features\n\nTo get started with development:\n\n```sh\ngit clone https://github.com/ankane/logstop.git\ncd logstop\nbundle install\nbundle exec rake test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fankane%2Flogstop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fankane%2Flogstop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fankane%2Flogstop/lists"}