log_toolbox 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +9 -1
- data/lib/log_toolbox/log_simple.rb +5 -1
- data/lib/log_toolbox/version.rb +1 -1
- data/log_toolbox.gemspec +2 -0
- metadata +30 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57fc2307fa88005cade48e4ca2ec7d7eb2fc160f96df2200ee8da7e87d721620
|
4
|
+
data.tar.gz: cbcffcc9ff47fe85c034eb3dcf41c8e025e14ef0b259138ab31e1a1ca746ef87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6a625722e73a5d4497f75917180af29cf35539038b914223d33c2db9ba26fbcc39e246a2fcaaad48f0a8343efd52b41fbc96cd73c0f019c7a141bcce3b9299e
|
7
|
+
data.tar.gz: c02133b3f39b44d36b791408f53e25bfae822d99446de414b4e213ad5edbc8976a87859a7bf67ab982099bf9699846be5f3eac54add3c01dbfb0d3bfadc849d8
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
6
6
|
|
7
7
|
## [Released] - 2019-05-21
|
8
8
|
|
9
|
+
## [1.3.2] - 2020-02-19
|
10
|
+
### Fixed
|
11
|
+
- Fixed log simple sending to logstash
|
12
|
+
|
9
13
|
## [1.3.1] - 2019-07-30
|
10
14
|
### Fixed
|
11
15
|
- Missed log format on posting to logstash
|
data/README.md
CHANGED
@@ -22,7 +22,7 @@ $ gem install log_toolbox
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
|
25
|
+
Add this line at the end of your 'config/application.rb'
|
26
26
|
|
27
27
|
```ruby
|
28
28
|
LogToolbox::LogrageConfig.configure
|
@@ -36,6 +36,14 @@ class ApplicationController < ActionController::API
|
|
36
36
|
end
|
37
37
|
```
|
38
38
|
|
39
|
+
Add these keys at your '.env' file
|
40
|
+
|
41
|
+
```ruby
|
42
|
+
# Logstash
|
43
|
+
LOGSTASH_URL=utils-hml.aws.guideinvestimentos.com.br
|
44
|
+
LOGSTASH_PORT=5001
|
45
|
+
```
|
46
|
+
|
39
47
|
Now your application log was converted to json pattern.
|
40
48
|
|
41
49
|
### Log at controller
|
@@ -15,11 +15,15 @@ module LogToolbox
|
|
15
15
|
log_pattern('info', additional.merge(message: message))
|
16
16
|
end
|
17
17
|
|
18
|
+
def log_debug(message, additional = {})
|
19
|
+
log_pattern('debug', additional.merge(message: message))
|
20
|
+
end
|
21
|
+
|
18
22
|
private
|
19
23
|
|
20
24
|
def log_pattern(level, log_hash)
|
21
25
|
log = default_log(level.upcase).merge(log_hash)
|
22
|
-
|
26
|
+
Rails.logger.send(level, normalize_hash(log))
|
23
27
|
end
|
24
28
|
|
25
29
|
def default_log(level)
|
data/lib/log_toolbox/version.rb
CHANGED
data/log_toolbox.gemspec
CHANGED
@@ -25,6 +25,8 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.add_dependency 'logstash-event', '>= 1.2.02'
|
26
26
|
spec.add_dependency 'logstash-logger', '>= 0.26.1'
|
27
27
|
spec.add_dependency 'rails', ['>= 4.0']
|
28
|
+
spec.add_dependency 'rspec', '>= 3.0.0'
|
29
|
+
spec.add_dependency 'rspec-rails'
|
28
30
|
|
29
31
|
spec.add_development_dependency 'bundler'
|
30
32
|
spec.add_development_dependency 'pry'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: log_toolbox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Caio Almeida
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lograge
|
@@ -66,6 +66,34 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '4.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 3.0.0
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 3.0.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rspec-rails
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
69
97
|
- !ruby/object:Gem::Dependency
|
70
98
|
name: bundler
|
71
99
|
requirement: !ruby/object:Gem::Requirement
|