README.md in lograge-sql-2.0.0 vs README.md in lograge-sql-2.1.0

- old
+ new

@@ -1,9 +1,9 @@ # Lograge::Sql [![Gem Version](https://badge.fury.io/rb/lograge-sql.svg)](https://badge.fury.io/rb/lograge-sql) -[![Build Status](https://travis-ci.org/iMacTia/lograge-sql.svg)](https://travis-ci.org/iMacTia/lograge-sql) +[![CI](https://github.com/iMacTia/lograge-sql/actions/workflows/ci.yml/badge.svg)](https://github.com/iMacTia/lograge-sql/actions/workflows/ci.yml) Lograge::Sql is an extension to the famous [Lograge](https://github.com/roidrage/lograge) gem, which adds SQL queries to the Lograge Event and disable default ActiveRecord logging. This is extremely useful if you're using Lograge together with the ELK stack. ## Installation @@ -64,13 +64,24 @@ sql_queries end end ``` +`Lograge-sql` only stores any events by `min_duration_ms` condition. +It very helpful if you want to detect `Slow SQL queries` + +```ruby +# config/initializers/lograge.rb +Rails.application.configure do + # Set limitted of SQL duration if you want to filter (unit: milliseconds) + # Defaults is zero + config.lograge_sql.min_duration_ms = 5000 +end +``` + #### Thread-safety [Depending on the web server in your project](https://github.com/steveklabnik/request_store#the-problem) you might benefit from improved thread-safety by adding [`request_store`](https://github.com/steveklabnik/request_store) to your Gemfile. It will be automatically picked up by `lograge-sql`. ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/iMacTia/lograge-sql. -