rails_api_logger 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +4 -0
- data/lib/rails_api_logger/request_log.rb +1 -1
- data/lib/rails_api_logger/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '00489e11faa84622f3557560cf9d989b1fb36f6c6d18fdd41f1f1784e59893dd'
|
4
|
+
data.tar.gz: 54f3202bd8446cce3a32c97a2da3b2f881d317207c511bf1d9ada9250ac751d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 254e3a0054438fa416561f5e34155529f4860d255cb01e80c5ea5a5a65bac694b35bc6b88199775b1fa11bc6532981f6e514b517f703140020c6b9618284ce1e
|
7
|
+
data.tar.gz: bf5537dfcb5eec1c675b9eb68bee42a8700fa756d1728666c67075a77a9f99baf0f573b5090e36dd6e345c0d5471b923fbcaddd8f689c257e89c496e858722cd
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Rails API Logger
|
2
2
|
|
3
|
+
The simplest way to log API requests of your Rails application in your database.
|
4
|
+
|
3
5
|
The Rails API logger gem introduces a set of tools to log and debug API requests.
|
4
6
|
It works on two sides:
|
5
7
|
|
@@ -16,6 +18,8 @@ This gem creates two database tables to log the following information:
|
|
16
18
|
* **request_body** what was included in the request body
|
17
19
|
* **response_body** what was included in the response body
|
18
20
|
* **response_code** the HTTP response code of the request
|
21
|
+
* **started_at** when the request started
|
22
|
+
* **ended_at** when the request finished
|
19
23
|
|
20
24
|
## Installation
|
21
25
|
|
@@ -6,7 +6,7 @@ class RequestLog < ActiveRecord::Base
|
|
6
6
|
|
7
7
|
belongs_to :loggable, optional: true, polymorphic: true
|
8
8
|
|
9
|
-
scope :failed, -> { where(
|
9
|
+
scope :failed, -> { where.not(response_code: 200..299) }
|
10
10
|
|
11
11
|
validates :method, presence: true
|
12
12
|
validates :path, presence: true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_api_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alessandro Rodi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|