le 2.6.2 → 2.7.0
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/LE.gemspec +1 -1
- data/lib/le.rb +2 -1
- data/lib/le/host/http.rb +24 -12
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f868809dc5b8c942e3221ae1dbd81fca04a20c3b
|
4
|
+
data.tar.gz: 8c3ef731110ec76884f561f9d2b1e65ee4442806
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d06967717dd86c45f44c22e7ee05158bae3aae779489dab6edb0a90189d13f3475b202cca33a2c515e5623540b991e0bd7d4da851359b55698e31d7da1fa562f
|
7
|
+
data.tar.gz: ca4b927f33ee74afdff3fc350daa35270d63cc96691304cb83a4c7cdb42a69ee03cf53e05330396a3de3c5d62a28825b3d6d9d543bc856d0edafcad75facb925
|
data/LE.gemspec
CHANGED
data/lib/le.rb
CHANGED
@@ -22,11 +22,12 @@ module Le
|
|
22
22
|
opt_custom_host = options[:custom_host] || [false, '']
|
23
23
|
|
24
24
|
opt_udp_port = options[:udp_port] || nil
|
25
|
+
opt_use_data_endpoint = options[:data_endpoint] || false
|
25
26
|
|
26
27
|
self.checkParams(token, opt_datahub_enabled, opt_udp_port)
|
27
28
|
|
28
29
|
|
29
|
-
host = Le::Host.new(token, opt_local, opt_debug, opt_ssl, opt_datahub_endpoint, opt_host_id, opt_custom_host, opt_udp_port)
|
30
|
+
host = Le::Host.new(token, opt_local, opt_debug, opt_ssl, opt_datahub_endpoint, opt_host_id, opt_custom_host, opt_udp_port, opt_use_data_endpoint)
|
30
31
|
|
31
32
|
if defined?(ActiveSupport::TaggedLogging) && opt_tag
|
32
33
|
logger = ActiveSupport::TaggedLogging.new(Logger.new(host))
|
data/lib/le/host/http.rb
CHANGED
@@ -8,7 +8,9 @@ module Le
|
|
8
8
|
module Host
|
9
9
|
class HTTP
|
10
10
|
API_SERVER = 'api.logentries.com'
|
11
|
-
|
11
|
+
DATA_ENDPOINT = 'data.logentries.com'
|
12
|
+
DATA_PORT_UNSECURE = 80
|
13
|
+
DATA_PORT_SECURE = 443
|
12
14
|
API_PORT = 10000
|
13
15
|
API_SSL_PORT = 20000
|
14
16
|
SHUTDOWN_COMMAND = "DIE!DIE!" # magic command string for async worker to shutdown
|
@@ -18,10 +20,10 @@ module Le
|
|
18
20
|
|
19
21
|
include Le::Host::InstanceMethods
|
20
22
|
#! attr_accessor :token, :queue, :started, :thread, :conn, :local, :debug, :ssl, :datahub_enabled, :dathub_ip, :datahub_port, :host_id, :custom_host, :host_name_enabled, :host_name
|
21
|
-
attr_accessor :token, :queue, :started, :thread, :conn, :local, :debug, :ssl, :datahub_enabled, :datahub_ip, :datahub_port, :datahub_endpoint, :host_id, :host_name_enabled, :host_name, :custom_host, :udp_port
|
23
|
+
attr_accessor :token, :queue, :started, :thread, :conn, :local, :debug, :ssl, :datahub_enabled, :datahub_ip, :datahub_port, :datahub_endpoint, :host_id, :host_name_enabled, :host_name, :custom_host, :udp_port, :use_datahub_endpoint
|
22
24
|
|
23
25
|
|
24
|
-
def initialize(token, local, debug, ssl, datahub_endpoint, host_id, custom_host, udp_port)
|
26
|
+
def initialize(token, local, debug, ssl, datahub_endpoint, host_id, custom_host, udp_port, use_datahub_endpoint)
|
25
27
|
if local
|
26
28
|
device = if local.class <= TrueClass
|
27
29
|
if defined?(Rails)
|
@@ -39,6 +41,7 @@ module Le
|
|
39
41
|
@debug= debug
|
40
42
|
@ssl = ssl
|
41
43
|
@udp_port = udp_port
|
44
|
+
@use_datahub_endpoint = use_datahub_endpoint
|
42
45
|
|
43
46
|
@datahub_endpoint = datahub_endpoint
|
44
47
|
if !@datahub_endpoint[0].empty?
|
@@ -163,15 +166,24 @@ module Le
|
|
163
166
|
def openConnection
|
164
167
|
dbg "LE: Reopening connection to Logentries API server"
|
165
168
|
|
166
|
-
if @
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
169
|
+
if @use_datahub_endpoint
|
170
|
+
host = DATA_ENDPOINT
|
171
|
+
if @ssl
|
172
|
+
port = DATA_PORT_SECURE
|
173
|
+
else
|
174
|
+
port = DATA_PORT_UNSECURE
|
175
|
+
end
|
176
|
+
else
|
177
|
+
if @udp_port
|
178
|
+
host = API_SERVER
|
179
|
+
port = @udp_port
|
180
|
+
elsif @datahub_enabled
|
181
|
+
host = @datahub_ip
|
182
|
+
port = @datahub_port
|
183
|
+
else
|
184
|
+
host = API_SERVER
|
185
|
+
port = @ssl ? API_SSL_PORT: API_PORT
|
186
|
+
end
|
175
187
|
end
|
176
188
|
|
177
189
|
if @udp_port
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: le
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Lacomber
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
95
95
|
version: '0'
|
96
96
|
requirements: []
|
97
97
|
rubyforge_project:
|
98
|
-
rubygems_version: 2.
|
98
|
+
rubygems_version: 2.0.14
|
99
99
|
signing_key:
|
100
100
|
specification_version: 4
|
101
101
|
summary: Logentries plugin
|