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 +4 -4
- data/lib/logstasher/railtie.rb +16 -1
- data/lib/logstasher/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73fe929a52a1421487fc60f7125a2aa16f9e0ed4
|
4
|
+
data.tar.gz: a57221921ecff9275dce29953ae63b36d4ce3d19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b706c62313108c305c9b2c543e278c1bf4d485a2bed0f29bdb44d1ace6686d7988e522ba5e69b4036460d6ecf40b9d3cbbc6dd4d53a8d831e29904c07ed17ae0
|
7
|
+
data.tar.gz: e5788207b057d4a21684f51fdc236028ed84448cb4a0114df16c2eb98d5de87faa7f3095138f5e9accd0d88585edbee6109f5b5ec8692650fc5d154adbff3bda
|
data/lib/logstasher/railtie.rb
CHANGED
@@ -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] :
|
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
|
data/lib/logstasher/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2017-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logstash-event
|