timber 2.3.4 → 2.4.0

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
  SHA1:
3
- metadata.gz: 80e874d6c7511eb027b0fb5c6f158fa58d93eb15
4
- data.tar.gz: 81a0be2c8a18fbb5ee8687aea6e1bd2a34cd23ec
3
+ metadata.gz: 4473feee6c4bed1f4a2d42843d6216ee9dc65610
4
+ data.tar.gz: 9dd9a9da2061ca1c3f01969ec341a08f58afb776
5
5
  SHA512:
6
- metadata.gz: 1ac3d4ea379abcdc2d3dfba2b6ac6c71145d14445c181b3803db79a793658a67a8e792de4d6fd8936758ad7d4346206da0b4453400216a13c97da35ea72f7fc7
7
- data.tar.gz: cb0c1da3df06dd332300bddc76f5a9a9dc9a006371003b93c83310678daf73b0bbd2edef267616af414982206baf2a75d27074c496eb2b7dcf1007a51264674c
6
+ metadata.gz: bd0d89058be50f3fea6a55c957abbfb62c883114718e0b744a8833d44a09e2ce2ebb02df55d2d8e2b482e3d3cbfed41d982197dab49fe2ef7f5f1b8e8309929f
7
+ data.tar.gz: 4b0d17af89a7a89b2ad7933d2be3161798c5430b220dc512e177cf6c2d22285725b61be0ff164d0d9f5be9970e6073e7a8387fd430c2c7284f597e4658b6ffc5
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.4.0] - 2017-10-23
11
+
12
+ ### Added
13
+
14
+ - Adds the new `host` field into the `http` context, bumping the log event JSON schema to `3.2.0`.
15
+
10
16
  ## [2.3.4] - 2017-10-12
11
17
 
12
18
  ### Fixed
@@ -72,7 +78,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
72
78
  instead of applying back pressure.
73
79
 
74
80
 
75
- [Unreleased]: https://github.com/timberio/timber-ruby/compare/v2.3.4...HEAD
81
+ [Unreleased]: https://github.com/timberio/timber-ruby/compare/v2.4.0...HEAD
82
+ [2.4.0]: https://github.com/timberio/timber-ruby/compare/v2.3.4...v2.4.0
76
83
  [2.3.4]: https://github.com/timberio/timber-ruby/compare/v2.3.3...v2.3.4
77
84
  [2.3.3]: https://github.com/timberio/timber-ruby/compare/v2.3.2...v2.3.3
78
85
  [2.3.2]: https://github.com/timberio/timber-ruby/compare/v2.3.1...v2.3.2
@@ -15,18 +15,20 @@ module Timber
15
15
  class HTTP < Context
16
16
  @keyspace = :http
17
17
 
18
- attr_reader :method, :path, :remote_addr, :request_id
18
+ attr_reader :host, :method, :path, :remote_addr, :request_id
19
19
 
20
20
  def initialize(attributes)
21
+ @host = attributes[:host]
21
22
  @method = attributes[:method] || raise(ArgumentError.new(":method is required"))
22
- @path = attributes[:path] || raise(ArgumentError.new(":path is required"))
23
+ @path = attributes[:path]
23
24
  @remote_addr = attributes[:remote_addr]
24
25
  @request_id = attributes[:request_id]
25
26
  end
26
27
 
27
28
  # Builds a hash representation containing simple objects, suitable for serialization (JSON).
28
29
  def as_json(_options = {})
29
- {:method => method, :path => path, :remote_addr => remote_addr, :request_id => request_id}
30
+ {:host => host, :method => method, :path => path, :remote_addr => remote_addr,
31
+ :request_id => request_id}
30
32
  end
31
33
  end
32
34
  end
@@ -11,6 +11,7 @@ module Timber
11
11
  def call(env)
12
12
  request = Util::Request.new(env)
13
13
  context = Contexts::HTTP.new(
14
+ host: request.host,
14
15
  method: request.request_method,
15
16
  path: request.path,
16
17
  remote_addr: request.ip,
@@ -11,7 +11,7 @@ module Timber
11
11
  BINARY_LIMIT_THRESHOLD = 1_000.freeze
12
12
  DT_PRECISION = 6.freeze
13
13
  MESSAGE_MAX_BYTES = 8192.freeze
14
- SCHEMA = "https://raw.githubusercontent.com/timberio/log-event-json-schema/v3.1.3/schema.json".freeze
14
+ SCHEMA = "https://raw.githubusercontent.com/timberio/log-event-json-schema/v3.2.0/schema.json".freeze
15
15
 
16
16
  attr_reader :context_snapshot, :event, :level, :message, :progname, :tags, :time, :time_ms
17
17
 
@@ -1,3 +1,3 @@
1
1
  module Timber
2
- VERSION = "2.3.4"
2
+ VERSION = "2.4.0"
3
3
  end
@@ -42,12 +42,12 @@ if defined?(::Rack)
42
42
  dispatch_rails_request("/rack_http")
43
43
  http_context = Thread.current[:_timber_context_snapshot][:http]
44
44
 
45
- expect(http_context).to eq({:method=>"GET", :path=>"/rack_http", :remote_addr=>"123.456.789.10", :request_id=>"unique-request-id-1234"})
45
+ expect(http_context).to eq({:host => "example.org", :method=>"GET", :path=>"/rack_http", :remote_addr=>"123.456.789.10", :request_id=>"unique-request-id-1234"})
46
46
 
47
47
  lines = clean_lines(io.string.split("\n"))
48
48
  expect(lines.length).to eq(3)
49
49
  lines.each do |line|
50
- expect(line).to include("\"http\":{\"method\":\"GET\",\"path\":\"/rack_http\",\"remote_addr\":\"123.456.789.10\",\"request_id\":\"unique-request-id-1234\"}")
50
+ expect(line).to include("\"http\":{\"host\":\"example.org\",\"method\":\"GET\",\"path\":\"/rack_http\",\"remote_addr\":\"123.456.789.10\",\"request_id\":\"unique-request-id-1234\"}")
51
51
  end
52
52
  end
53
53
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timber
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.4
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Timber Technologies, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-12 00:00:00.000000000 Z
11
+ date: 2017-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack