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.
- checksums.yaml +4 -4
- data/README.md +18 -14
- data/lib/lograge/sql/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6df7e9d756f02019ce93cbac6c0b19a275035a9d0fe74c631aa699eecf149f6f
|
4
|
+
data.tar.gz: d34996be2888e4d234d914de95ee092e2b2380181dd70f4b70b2fe84fdc7cc97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
##
|
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
|
-
|
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
|
|
data/lib/lograge/sql/version.rb
CHANGED
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.
|
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-
|
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.
|
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.
|
32
|
+
version: '7.2'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: lograge
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|