logstasher 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9a60d2be7649b262d3f67ea619acfb55098bcdd8
4
- data.tar.gz: ceae4aaaf89e942b71cde7fa7d7458e059d1242c
3
+ metadata.gz: 73fe929a52a1421487fc60f7125a2aa16f9e0ed4
4
+ data.tar.gz: a57221921ecff9275dce29953ae63b36d4ce3d19
5
5
  SHA512:
6
- metadata.gz: 83e416250549c5bd16dad2f153726c501426338067e51b9757dfab5c805abfa6e173c0facc7684767545dcd5728be6bac3aa0a571786839793a5101619e34cac
7
- data.tar.gz: d5d930fb52ce3bbe1b3dd6d0f915bda97864d6079a496fde69c742d881777a5cc3b1d7a5c2f9d9a8f7c2305d27e14c839ae084906fb8d13e4f13eb61d5237570
6
+ metadata.gz: b706c62313108c305c9b2c543e278c1bf4d485a2bed0f29bdb44d1ace6686d7988e522ba5e69b4036460d6ecf40b9d3cbbc6dd4d53a8d831e29904c07ed17ae0
7
+ data.tar.gz: e5788207b057d4a21684f51fdc236028ed84448cb4a0114df16c2eb98d5de87faa7f3095138f5e9accd0d88585edbee6109f5b5ec8692650fc5d154adbff3bda
@@ -41,6 +41,21 @@ module LogStasher
41
41
  end
42
42
  end
43
43
 
44
+ def default_source
45
+ case RUBY_PLATFORM
46
+ when /darwin/
47
+ # NOTE: MacOS Sierra and later are setting `.local`
48
+ # hostnames that even as real hostnames without the `.local` part,
49
+ # are still unresolvable. One reliable way to get an IP is to
50
+ # get all available IP address lists and use the first one.
51
+ # This will always be `127.0.0.1`.
52
+ address_info = Socket.ip_address_list.first
53
+ address_info && address_info.ip_address
54
+ else
55
+ IPSocket.getaddress(Socket.gethostname)
56
+ end
57
+ end
58
+
44
59
  def process_config(config, yml_config)
45
60
  # Enable the logstasher logs for the current environment
46
61
  config.enabled = yml_config[:enabled] if yml_config.key? :enabled
@@ -54,7 +69,7 @@ module LogStasher
54
69
  config.suppress_app_log = yml_config[:suppress_app_log] if yml_config.key? :suppress_app_log
55
70
 
56
71
  # This line is optional, it allows you to set a custom value for the @source field of the log event
57
- config.source = yml_config.key?(:source) ? yml_config[:source] : IPSocket.getaddress(Socket.gethostname)
72
+ config.source = yml_config.key?(:source) ? yml_config[:source] : default_source
58
73
 
59
74
  config.backtrace = yml_config[:backtrace] if yml_config.key? :backtrace
60
75
  config.logger_path = yml_config[:logger_path] if yml_config.key? :logger_path
@@ -1,3 +1,3 @@
1
1
  module LogStasher
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstasher
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shadab Ahmed
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-01 00:00:00.000000000 Z
11
+ date: 2017-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logstash-event