log_toolbox 1.3.4 → 1.3.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5ac8156b11e49224b6a2505694346bee18bb52f0672befb14e6e711cff84b45d
4
- data.tar.gz: 5319f54b73100e5bc36ee754f8e62732fa6ded6560b73c97a93bdd72e4c1f3df
3
+ metadata.gz: 0705a34a5c6aa86c59b0b3f3ecacb12cd9c3e797684526614b9a86e71a9c0612
4
+ data.tar.gz: 22e86528f06686f9bf49b1279983deb10bf14cc0fa1b1c251293e44a98dfd43d
5
5
  SHA512:
6
- metadata.gz: 97d815d439efa23b6ac48b6aaaa7b977f5af22996460ab922fbf07cf3a99c65211e7ef530a59b3d378582d52f5ae9649a39ad374f31eda8d39b76550ef6ac319
7
- data.tar.gz: f8d09ba573af4f0f7ed1cf1c65900c39a0d7c3fb67e15cb0071f5c1302e305a22827afc2149156f357f81454a0dc0b80d108ce883a4f239cc4c616de45d0aabf
6
+ metadata.gz: 800ff4be159ad2b1e025bab0bff56b4ecdebb6bb36ac2a98bd371305a343b2bf87dec6644cd804c751431cdfecccefb43d58230f1ab24763d37703a6ea03b4f0
7
+ data.tar.gz: ba2f61765b621dd425a41dce2e050a57152a15dfe947af982f69b8cb7041a490a5fb608544a2ff6ecdc6f80f283fe47d80dd30683fe3889517d9f5a24d51792a
@@ -6,8 +6,28 @@ 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.9] - 2021-01-15
10
+ ### FIXED
11
+ - Fixed service_name custom option.
12
+
13
+ ## [1.3.8] - 2020-12-10
14
+ ### FIXED
15
+ - Fixed LogStash configs
16
+
17
+ ## [1.3.7] - 2020-12-08
18
+ ### Added
19
+ - Configure log output stdout to development and test environment
20
+
21
+ ## [1.3.6] - 2020-12-08
22
+ ### FIXED
23
+ - Added buffer_max_items and buffer_max_interval into LogStash config
24
+
25
+ ## [1.3.5] - 2020-12-04
26
+ ### FIXED
27
+ - Convert buffer_max_items and buffer_max_interval values to integer
28
+
9
29
  ## [1.3.4] - 2020-12-03
10
- ### Addd
30
+ ### Added
11
31
  - Add settings to buffer_max_items and buffer_max_interval
12
32
 
13
33
  ## [1.3.3] - 2020-11-25
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- log_toolbox (1.3.3)
4
+ log_toolbox (1.3.5)
5
5
  lograge (>= 0.11.1)
6
6
  logstash-event (>= 1.2.02)
7
7
  logstash-logger (>= 0.26.1)
@@ -10,14 +10,14 @@ module LogToolbox
10
10
  LOGSTASH_URL = ENV['LOGSTASH_URL']
11
11
  LOGSTASH_PORT = ENV['LOGSTASH_PORT']
12
12
  LOGSTASH_PROTOCOL = ENV.fetch('LOGSTASH_PROTOCOL', 'udp')
13
- LOGSTASH_BUFFER_MAX_ITEMS = ENV['LOGSTASH_BUFFER_MAX_ITEMS']
14
- LOGSTASH_BUFFER_MAX_INTERVAL = ENV['LOGSTASH_BUFFER_MAX_INTERVAL']
13
+ LOGSTASH_BUFFER_MAX_ITEMS = ENV.fetch('LOGSTASH_BUFFER_MAX_ITEMS', 50).to_i
14
+ LOGSTASH_BUFFER_MAX_INTERVAL = ENV.fetch('LOGSTASH_BUFFER_MAX_INTERVAL', 5).to_i
15
15
 
16
16
  def self.configure
17
17
  Rails.application.configure do
18
18
  log_config = LogToolbox::LogrageConfig.new(config)
19
19
  log_config.configure_log_format
20
- if ENV['RAILS_ENV'] == 'development'
20
+ if %w[development test].include?(ENV['RAILS_ENV'])
21
21
  log_config.configure_log_output_stdout
22
22
  else
23
23
  log_config.configure_log_output_logstash
@@ -30,11 +30,11 @@ module LogToolbox
30
30
  end
31
31
 
32
32
  def configure_log_output_logstash
33
- config.logger = LogStashLogger.new(type: LOGSTASH_PROTOCOL,
34
- host: LOGSTASH_URL,
35
- port: LOGSTASH_PORT,
36
- buffer_max_items: LOGSTASH_BUFFER_MAX_ITEMS || 50,
37
- buffer_max_interval: LOGSTASH_BUFFER_MAX_INTERVAL || 5)
33
+ config.logstash.type = LOGSTASH_PROTOCOL
34
+ config.logstash.host = LOGSTASH_URL
35
+ config.logstash.port = LOGSTASH_PORT
36
+ config.logstash.buffer_max_items = LOGSTASH_BUFFER_MAX_ITEMS
37
+ config.logstash.buffer_max_interval = LOGSTASH_BUFFER_MAX_INTERVAL
38
38
  end
39
39
 
40
40
  def configure_log_output_stdout
@@ -56,7 +56,7 @@ module LogToolbox
56
56
  event_at: event.payload[:event_at],
57
57
  parameters: event.payload[:params].to_json,
58
58
  level: 'INFO',
59
- service_name: event.payload[:service_name],
59
+ service_name: event.payload[:service_name] || LogUtil.system_service_name,
60
60
  version: event.payload[:version],
61
61
  origin_ipv4: event.payload[:origin_ipv4],
62
62
  destination_ipv4: event.payload[:destination_ipv4],
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LogToolbox
4
- VERSION = '1.3.4'
4
+ VERSION = '1.3.9'
5
5
  end
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
11
11
  spec.authors = ['Caio Almeida']
12
12
  spec.email = ['cbalmeida@guide.com.br']
13
13
 
14
- spec.required_ruby_version = '>= 2.4.0'
14
+ spec.required_ruby_version = '>= 2.5.0'
15
15
  spec.summary = 'Guide default gem for ruby application logging'
16
16
  spec.homepage = 'http://bitbucket.org/guideinvestimentos/log_toolbox'
17
17
  spec.license = 'Guide'
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
4
+ version: 1.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Caio Almeida
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-04 00:00:00.000000000 Z
11
+ date: 2021-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lograge
@@ -234,7 +234,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
234
234
  requirements:
235
235
  - - ">="
236
236
  - !ruby/object:Gem::Version
237
- version: 2.4.0
237
+ version: 2.5.0
238
238
  required_rubygems_version: !ruby/object:Gem::Requirement
239
239
  requirements:
240
240
  - - ">="