{"id":15048219,"url":"https://github.com/github/redacting-logger","last_synced_at":"2025-10-19T22:32:57.311Z","repository":{"id":207046584,"uuid":"718291223","full_name":"github/redacting-logger","owner":"github","description":"A redacting Ruby logger to prevent the leaking of secrets via logs","archived":false,"fork":false,"pushed_at":"2025-01-14T21:52:37.000Z","size":23564,"stargazers_count":9,"open_issues_count":4,"forks_count":2,"subscribers_count":36,"default_branch":"main","last_synced_at":"2025-01-29T17:01:40.315Z","etag":null,"topics":["gem","logging","redact","ruby","security-tools"],"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/github.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-13T19:30:00.000Z","updated_at":"2025-01-09T20:00:26.000Z","dependencies_parsed_at":"2024-02-05T18:55:52.807Z","dependency_job_id":"ca6e7fd1-24ab-4688-bc31-f6ec9948acfa","html_url":"https://github.com/github/redacting-logger","commit_stats":null,"previous_names":["grantbirki/redacting-logger","grantbirki/redactinglogger","github/redacting-logger"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fredacting-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fredacting-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fredacting-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/github%2Fredacting-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/github","download_url":"https://codeload.github.com/github/redacting-logger/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237224903,"owners_count":19275107,"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":["gem","logging","redact","ruby","security-tools"],"created_at":"2024-09-24T21:09:26.154Z","updated_at":"2025-10-19T22:32:56.516Z","avatar_url":"https://github.com/github.png","language":"Ruby","readme":"# redacting-logger\n\n[![test](https://github.com/github/redacting-logger/actions/workflows/test.yml/badge.svg)](https://github.com/github/redacting-logger/actions/workflows/test.yml) [![lint](https://github.com/github/redacting-logger/actions/workflows/lint.yml/badge.svg)](https://github.com/github/redacting-logger/actions/workflows/lint.yml) [![build](https://github.com/github/redacting-logger/actions/workflows/build.yml/badge.svg)](https://github.com/github/redacting-logger/actions/workflows/build.yml) [![CodeQL](https://github.com/github/redacting-logger/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/github/redacting-logger/actions/workflows/codeql-analysis.yml) [![release](https://github.com/github/redacting-logger/actions/workflows/release.yml/badge.svg)](https://github.com/github/redacting-logger/actions/workflows/release.yml)\n\nA redacting Ruby logger to prevent the leaking of secrets via logs\n\n\u003e This Gem wraps the official Ruby [`logger`](https://github.com/ruby/logger) utility\n\n![Gem](docs/assets/gem.png)\n\n## Installation 💎\n\nYou can download this Gem from [GitHub Packages](https://github.com/github/redacting-logger/pkgs/rubygems/redacting-logger) or [RubyGems](https://rubygems.org/gems/redacting-logger)\n\nVia a Gemfile:\n\n```ruby\nsource \"https://rubygems.org\"\n\ngem \"redacting-logger\", \"~\u003e X.X.X\" # Replace X.X.X with the latest version\n```\n\n## Usage 💻\n\n### Basic\n\n```ruby\nrequire \"redacting_logger\"\n\n# Create a new logger\nlogger = RedactingLogger.new(redact_patterns: [/topsecret/])\n\n# Log a message that contains some redacted pattern\nlogger.info(\"This is a topsecret message.\")\n```\n\nThis will output:\n\n```text\nI, [timestamp]  INFO -- : This is a [REDACTED] message.\n```\n\n### Advanced\n\n```ruby\nrequire \"redacting_logger\"\n\n# Create a new logger\nlogger = RedactingLogger.new(\n  $stdout, # The device to log to (defaults to $stdout if not provided)\n  redact_patterns: [/REDACTED_PATTERN1/, /REDACTED_PATTERN2/], # An array of Regexp patterns to redact from the logs\n  level: Logger::INFO, # The log level to use\n  redacted_msg: \"[REDACTED]\", # The message to replace the redacted patterns with\n  use_default_patterns: true # Whether to use the default built-in patterns or not\n)\n\n# Log a message that contains some redacted patterns\nlogger.info(\"This is a message with a REDACTED_PATTERN1 and REDACTED_PATTERN2 in it.\")\n```\n\nThis will output:\n\n```text\nI, [timestamp]  INFO -- : This is a message with a [REDACTED] and [REDACTED] in it.\n```\n\n## Default Redaction Patterns\n\nThis Gem comes pre-built with a few redaction patterns to help you get started. These patterns can be located in [`lib/patterns/default.rb`](lib/patterns/default.rb)\n\nA few examples of these patterns are:\n\n- GitHub Personal Access Tokens\n- GitHub Temporary Actions Tokens\n- RSA Private Keys\n- JWT Tokens\n\nYou can disable these default patterns with:\n\n```ruby\nlogger = RedactingLogger.new(\n  use_default_patterns: false # Whether to use the default built-in patterns or not\n)\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Fredacting-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgithub%2Fredacting-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithub%2Fredacting-logger/lists"}