lograge-sql 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -14
  3. data/lib/lograge/sql/version.rb +1 -1
  4. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0794c5325c6cc647ab9e133b0ac1ebfee558311f12b26861c0776866a6cc27fb'
4
- data.tar.gz: b2bae9007ad19926f3ba0fed85bb6a965b942e70a537ed50b4230f071834af8f
3
+ metadata.gz: 6df7e9d756f02019ce93cbac6c0b19a275035a9d0fe74c631aa699eecf149f6f
4
+ data.tar.gz: d34996be2888e4d234d914de95ee092e2b2380181dd70f4b70b2fe84fdc7cc97
5
5
  SHA512:
6
- metadata.gz: 72222b28288cc38a14533c3a3babe408aa2d834dc19ba7f323ac9f7aeca167d55ad7ba2fc3af777e35fa643f7850901378282ee6865bbe4246edc410dff68ad2
7
- data.tar.gz: f4a956079f4562b3f24737adc851fb78ca41d70b6e8555e3eda42c436b0c88af28a109d3db4e54c2b36c1d0d21ef67a8c344bcb5a5b22b7884d2b9268fbca0cd
6
+ metadata.gz: 9ef329876869d54eab7e71bf64345917185dfc2ad06d33cb3649689ddaa51ea7b257a425f5b1fb2c39da57b6b26e051d2a13a2d1687b51e99b8813f39be7e12f
7
+ data.tar.gz: c15d0baabaaede38e6d949fe64d1abf1f14229ac2160b3d8b6a3b70a2ea117e49f0b4c36693f467622d42af862a1dd27d89e3066d44938a4d83bf35633cc170c
data/README.md CHANGED
@@ -29,7 +29,23 @@ By default, Lograge::Sql disables default logging on ActiveRecord. To preserve d
29
29
  config.lograge_sql.keep_default_active_record_log = true
30
30
  ```
31
31
 
32
- ## Customization
32
+ ## Configuration
33
+
34
+ ### Minimum query duration threshold
35
+
36
+ By default, `lograge-sql` stores all queries, but you can set a `min_duration_ms` config.
37
+ When you do so, only queries that run for AT LEAST `min_duration_ms` milliseconds will be logged, and all others will be ignored.
38
+ This can be really helpful if you want to detect `Slow SQL queries`.
39
+
40
+ ```ruby
41
+ # config/initializers/lograge.rb
42
+ Rails.application.configure do
43
+ # Defaults is zero
44
+ config.lograge_sql.min_duration_ms = 5000 # milliseconds
45
+ end
46
+ ```
47
+
48
+ ### Output Customization
33
49
 
34
50
  By default, the format is a string concatenation of the query name, the query duration and the query itself joined by `\n` newline:
35
51
 
@@ -66,19 +82,7 @@ Rails.application.configure do
66
82
  end
67
83
  ```
68
84
 
69
- `Lograge-sql` only stores any events by `min_duration_ms` condition.
70
- It very helpful if you want to detect `Slow SQL queries`
71
-
72
- ```ruby
73
- # config/initializers/lograge.rb
74
- Rails.application.configure do
75
- # Set limitted of SQL duration if you want to filter (unit: milliseconds)
76
- # Defaults is zero
77
- config.lograge_sql.min_duration_ms = 5000
78
- end
79
- ```
80
-
81
- #### Thread-safety
85
+ ### Thread-safety
82
86
 
83
87
  [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`.
84
88
 
@@ -3,6 +3,6 @@
3
3
  module Lograge
4
4
  module Sql
5
5
  # Gem version
6
- VERSION = '2.1.0'
6
+ VERSION = '2.2.0'
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lograge-sql
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mattia Giuffrida
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-25 00:00:00.000000000 Z
11
+ date: 2023-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '5'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '7.1'
22
+ version: '7.2'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '5'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '7.1'
32
+ version: '7.2'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: lograge
35
35
  requirement: !ruby/object:Gem::Requirement