{"id":15793317,"url":"https://github.com/pinzolo/rails-flog","last_synced_at":"2025-06-13T23:37:39.156Z","repository":{"id":12116437,"uuid":"14706343","full_name":"pinzolo/rails-flog","owner":"pinzolo","description":"Rails log formatter for Parameters and SQL.","archived":false,"fork":false,"pushed_at":"2021-12-24T16:16:22.000Z","size":145,"stargazers_count":68,"open_issues_count":0,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-16T06:37:37.253Z","etag":null,"topics":["rails","ruby","rubygems"],"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/pinzolo.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}},"created_at":"2013-11-26T03:51:39.000Z","updated_at":"2024-01-20T17:48:56.000Z","dependencies_parsed_at":"2022-09-05T11:11:41.513Z","dependency_job_id":null,"html_url":"https://github.com/pinzolo/rails-flog","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/pinzolo/rails-flog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinzolo%2Frails-flog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinzolo%2Frails-flog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinzolo%2Frails-flog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinzolo%2Frails-flog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pinzolo","download_url":"https://codeload.github.com/pinzolo/rails-flog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pinzolo%2Frails-flog/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259737491,"owners_count":22903839,"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":["rails","ruby","rubygems"],"created_at":"2024-10-04T23:10:34.339Z","updated_at":"2025-06-13T23:37:39.132Z","avatar_url":"https://github.com/pinzolo.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rails-flog\n\n[![Build Status](https://secure.travis-ci.org/pinzolo/rails-flog.png)](http://travis-ci.org/pinzolo/rails-flog)\n[![Coverage Status](https://coveralls.io/repos/pinzolo/rails-flog/badge.png)](https://coveralls.io/r/pinzolo/rails-flog)\n\nrails-flog provides feature that formats parameters Hash and SQL in Rails log file.\n\n## Before and after (Sample app: Redmine)\n\n### Before (Default)\n\n```\n# Parameters\nProcessing by IssuesController#create as HTML\n  Parameters: {\"utf8\"=\u003e\"✓\", \"authenticity_token\"=\u003e\"VYCWAsE+aAN+zSZq2H3ONNqaU8rlyfbnXLfbwDY1i10=\", \"issue\"=\u003e{\"is_private\"=\u003e\"0\", \"tracker_id\"=\u003e\"1\", \"subject\"=\u003e\"test ticket\", \"description\"=\u003e\"test ticket description\", \"status_id\"=\u003e\"1\", \"priority_id\"=\u003e\"2\", \"assigned_to_id\"=\u003e\"1\", \"parent_issue_id\"=\u003e\"\", \"start_date\"=\u003e\"2013-11-28\", \"due_date\"=\u003e\"2013-11-29\", \"estimated_hours\"=\u003e\"5\", \"done_ratio\"=\u003e\"10\"}, \"commit\"=\u003e\"Create\", \"project_id\"=\u003e\"test\"}\n\n# SQL\n  IssueCustomField Load (0.0ms)  SELECT \"custom_fields\".* FROM \"custom_fields\" WHERE \"custom_fields\".\"type\" IN ('IssueCustomField') AND (is_for_all = 't' OR id IN (SELECT DISTINCT cfp.custom_field_id FROM custom_fields_projects cfp WHERE cfp.project_id = 1)) ORDER BY custom_fields.position ASC\n```\n\n### After (Use rails-flog)\n\n```\n# Parameters\nProcessing by IssuesController#create as HTML\n  Parameters:\n{\n                  \"utf8\" =\u003e \"✓\",\n    \"authenticity_token\" =\u003e \"VYCWAsE+aAN+zSZq2H3ONNqaU8rlyfbnXLfbwDY1i10=\",\n                 \"issue\" =\u003e {\n             \"is_private\" =\u003e \"0\",\n             \"tracker_id\" =\u003e \"1\",\n                \"subject\" =\u003e \"test ticket\",\n            \"description\" =\u003e \"test ticket description\",\n              \"status_id\" =\u003e \"1\",\n            \"priority_id\" =\u003e \"2\",\n         \"assigned_to_id\" =\u003e \"1\",\n        \"parent_issue_id\" =\u003e \"\",\n             \"start_date\" =\u003e \"2013-11-28\",\n               \"due_date\" =\u003e \"2013-11-29\",\n        \"estimated_hours\" =\u003e \"5\",\n             \"done_ratio\" =\u003e \"10\"\n    },\n                \"commit\" =\u003e \"Create\",\n            \"project_id\" =\u003e \"test\"\n}\n\n# SQL\n  IssueCustomField Load (0.0ms)\n\tSELECT\n\t\t\"custom_fields\" . *\n\tFROM\n\t\t\"custom_fields\"\n\tWHERE\n\t\t\"custom_fields\" . \"type\" IN ('IssueCustomField')\n\t\tAND (\n\t\t\tis_for_all = 't'\n\t\t\tOR id IN (\n\t\t\t\tSELECT\n\t\t\t\t\t\tDISTINCT cfp.custom_field_id\n\t\t\t\t\tFROM\n\t\t\t\t\t\tcustom_fields_projects cfp\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tcfp.project_id = 1\n\t\t\t)\n\t\t)\n\tORDER BY\n\t\tcustom_fields.position ASC\n```\n\n## Installation\n\nAdd this line to your application's Gemfile:\n(Recommendation: use only `:development` and `:test` enviroment)\n\n    gem 'rails-flog', :require =\u003e \"flog\"\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install rails-flog\n\n## Usage\n\nJust install.\n\n## Configuration\n\nConfigure in your environment file (ex. `config/environments/development.rb`)\n\n```ruby\nFlog.configure do |config|\n  # If this value is true, not format on cached query\n  config.ignore_cached_query = false\n  # If query duration is under this value, not format\n  config.query_duration_threshold = 2.0\n  # If key count of parameters is under this value, not format\n  config.params_key_count_threshold = 2\n  # If this value is true, nested Hash parameter is formatted coercively in any situation\n  config.force_on_nested_params = false\n  # If this value is true, not format query\n  config.ignore_query = true\n  # If this value is true, not format parameters\n  config.ignore_params = true\nend\n```\n\n### Default value\n\n|Attribute                  |Data type |Default value |\n|:--------------------------|:---------|:-------------|\n|ignore_cached_query        |boolean   |true          |\n|query_duration_threshold   |float     |0.0           |\n|params_key_count_threshold |integer   |1             |\n|force_on_nested_params     |boolean   |true          |\n|ignore_query               |boolean   |false         |\n|ignore_params              |boolean   |false         |\n\n## Disable temporary\n\nIf you put a file to `\u003crails_app\u003e/tmp` direcotry, `rails-flog` will disable format.\nPriority of this feature is higher than configurations.\n\n|File name          |Feature    |\n|:------------------|:----------|\n|no-flog-sql.txt    |SQL        |\n|no-flog-params.txt |Parameters |\n|no-flog.txt        |Both       |\n\n## Supported versions\n\n- Ruby: 2.3.x, 2.4.x, 2.5.x, 2.6.x, 3.0.x\n- Rails: 5.1.x, 5.2.x, 6.0.x, 6.1.x, 7.0.x\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinzolo%2Frails-flog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpinzolo%2Frails-flog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpinzolo%2Frails-flog/lists"}