logstasher 2.1.3 → 2.1.5

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: 59cdc11b4f36e90443fcc8ea7332552874da2ad2205f38e4efac48c8e4dda63a
4
- data.tar.gz: 997cb22cb6799f67d28562e986e326fa23597ee5168a635bdc917d6a9bb65c6b
3
+ metadata.gz: 7af8fd26cf9b944ead0bf8b8b2df3a75aa405ca1e726529e7cccb1a38ae30e8d
4
+ data.tar.gz: aec3c7b2e41fefcb6f9c8b378c91d332537387685da9951cf741ab4ff2a0d9e3
5
5
  SHA512:
6
- metadata.gz: dd6d94a4055566fd119a570107724ce1fc1c1f3f1781f2929c248e4f2b227a3f95adb010b6e059f44cf49991f5baa1d9f3271f272efb5a97415104a265eb0e1b
7
- data.tar.gz: 35d3e80b5e460753033b327e41d51149d24b20c7b1321189a2ec24373ac5aa9c713189eba701ddc3ec5904fbf86a2b98657deff4c2a02fcfcee20f93c31fd9f9
6
+ metadata.gz: b65801d4d765f1f75f8939ee77e0ac88a5831e126f4428741097bce1b01b2c1ffe90a926aee5617bfe3355c9bfc80825299cfefd9666e52da008a22ad43368f7
7
+ data.tar.gz: 0d9bc2de4e965343f0ab12241d76e62a3e661b9bafa824cb532ee4df9768562ec83055af0c8462277b62efc8a0afdfc154b940bc38919500ec8a693bfce5009d
@@ -6,6 +6,21 @@ require 'action_controller/log_subscriber'
6
6
  require 'socket'
7
7
 
8
8
  module LogStasher
9
+ def default_source
10
+ case RUBY_PLATFORM
11
+ when /darwin/
12
+ # NOTE: MacOS Sierra and later are setting `.local`
13
+ # hostnames that even as real hostnames without the `.local` part,
14
+ # are still unresolvable. One reliable way to get an IP is to
15
+ # get all available IP address lists and use the first one.
16
+ # This will always be `127.0.0.1`.
17
+ address_info = Socket.ip_address_list.first
18
+ address_info&.ip_address
19
+ else
20
+ IPSocket.getaddress(Socket.gethostname)
21
+ end
22
+ end
23
+
9
24
  class Railtie < Rails::Railtie
10
25
  config.logstasher = ::ActiveSupport::OrderedOptions.new
11
26
  config.logstasher.enabled = false
@@ -16,6 +31,7 @@ module LogStasher
16
31
  config.logstasher.record_enabled = false
17
32
  config.logstasher.view_enabled = true
18
33
  config.logstasher.job_enabled = true
34
+ config.logstasher.source = LogStasher.default_source
19
35
 
20
36
  # Try loading the config/logstasher.yml if present
21
37
  env = Rails.env.to_sym || :development
@@ -48,21 +64,6 @@ module LogStasher
48
64
  end
49
65
  end
50
66
 
51
- def default_source
52
- case RUBY_PLATFORM
53
- when /darwin/
54
- # NOTE: MacOS Sierra and later are setting `.local`
55
- # hostnames that even as real hostnames without the `.local` part,
56
- # are still unresolvable. One reliable way to get an IP is to
57
- # get all available IP address lists and use the first one.
58
- # This will always be `127.0.0.1`.
59
- address_info = Socket.ip_address_list.first
60
- address_info&.ip_address
61
- else
62
- IPSocket.getaddress(Socket.gethostname)
63
- end
64
- end
65
-
66
67
  def process_config(config, yml_config)
67
68
  # Enable the logstasher logs for the current environment
68
69
  config.enabled = yml_config[:enabled] if yml_config.key? :enabled
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LogStasher
4
- VERSION = '2.1.3'
4
+ VERSION = '2.1.5'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstasher
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.3
4
+ version: 2.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shadab Ahmed