le 2.6.2 → 2.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/LE.gemspec +1 -1
  3. data/lib/le.rb +2 -1
  4. data/lib/le/host/http.rb +24 -12
  5. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8c813f3f25ebacaea6556a583b843c4dec615cf7
4
- data.tar.gz: bdabbfa54b2cc8a2455a7dee0b45d0c4a9408c69
3
+ metadata.gz: f868809dc5b8c942e3221ae1dbd81fca04a20c3b
4
+ data.tar.gz: 8c3ef731110ec76884f561f9d2b1e65ee4442806
5
5
  SHA512:
6
- metadata.gz: 173661ceff8b521680f1c750d656e884411ef8271e46c490880d50938a3fe55a9e8918e342d633063351199466dfdec4e2cba42f50e2042852a9b69d5470a77e
7
- data.tar.gz: 00a8b47741454df48435d42cecb75d3c1af86477773a606abd3e55cd20f28abd86da21d88a5abb55965c2fadae1a48bfe7f14127b1a17af0c3c7672753612f84
6
+ metadata.gz: d06967717dd86c45f44c22e7ee05158bae3aae779489dab6edb0a90189d13f3475b202cca33a2c515e5623540b991e0bd7d4da851359b55698e31d7da1fa562f
7
+ data.tar.gz: ca4b927f33ee74afdff3fc350daa35270d63cc96691304cb83a4c7cdb42a69ee03cf53e05330396a3de3c5d62a28825b3d6d9d543bc856d0edafcad75facb925
data/LE.gemspec CHANGED
@@ -5,7 +5,7 @@ require 'le'
5
5
 
6
6
  Gem::Specification.new do |gem|
7
7
  gem.name = "le"
8
- gem.version = "2.6.2"
8
+ gem.version = "2.7.0"
9
9
  gem.date = Time.now
10
10
  gem.summary = "Logentries plugin"
11
11
  gem.licenses = ["MIT"]
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))
@@ -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 @udp_port
167
- host = API_SERVER
168
- port = @udp_port
169
- elsif @datahub_enabled
170
- host = @datahub_ip
171
- port = @datahub_port
172
- else
173
- host = API_SERVER
174
- port = @ssl ? API_SSL_PORT: API_PORT
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.6.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: 2015-01-13 00:00:00.000000000 Z
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.2.2
98
+ rubygems_version: 2.0.14
99
99
  signing_key:
100
100
  specification_version: 4
101
101
  summary: Logentries plugin