logjam_agent 0.29.6 → 0.30.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
  SHA256:
3
- metadata.gz: ca8c03f4f1a6b89ca5fc1b9f89b6ac6141cead9b65b78918494eacc40b34205b
4
- data.tar.gz: 9f962e7fe7d2d379aa9f2b2889876ab79f9ea3542a0a15d3c2e1d072eda50f4a
3
+ metadata.gz: b351167b038a91fd392f94501012260ee84319fb6035b9bf5e35811d50c885b1
4
+ data.tar.gz: 838094a8022bf451422bb66219924737c5d32684c7a6194c979554f101b9071e
5
5
  SHA512:
6
- metadata.gz: 24b3f4c90acadac0659a2e38ab07bc351def08d21fe568da8cb6140955a39fce03784006d01cd9899652de163597e7e4ec766ec6f5c65c1cfd7d77e1d7aa03e1
7
- data.tar.gz: 3aaac4d51b15ec0f2c96784e821092b091b55c857da6a682c402d2315659863ec81f59acd769d3b4b64d450d07999edbdad83761b00585d4376ec57f4ec30489
6
+ metadata.gz: 78a136746231e26e873fcddf04740c0d748c29823e9db6fc9eabb43e9fd26cb10ec92f59eb687b70854f20a8fe918476287c171b3eca48f5006226c712ef0fb2
7
+ data.tar.gz: 84f8e23f8fbbc07e319e8cb928945a1c4f3198502d45a8e9a22e8dc4c9f9184f9283811c24ef40587c41d25badb6bfa3eceea7ca43b2468d3b15c1d49cb24393
@@ -109,7 +109,12 @@ module LogjamAgent
109
109
  self.obfuscated_cookies = [/_session\z/]
110
110
 
111
111
  def self.cookie_obfuscator
112
- @cookie_obfuscator ||= ActionDispatch::Http::ParameterFilter.new(obfuscated_cookies)
112
+ @cookie_obfuscator ||=
113
+ if defined?(ActiveSupport::ParameterFilter)
114
+ ActiveSupport::ParameterFilter.new(obfuscated_cookies)
115
+ else
116
+ ActionDispatch::Http::ParameterFilter.new(obfuscated_cookies)
117
+ end
113
118
  end
114
119
 
115
120
  extend RequestHandling
@@ -12,7 +12,7 @@ module LogjamAgent
12
12
  result[1] ||= {}
13
13
  result
14
14
  rescue Exception
15
- result = [500, {'Content-Type' => 'text/html'}, ["<html><body><h1>500 Internal Server Error</h1>"]]
15
+ result = [500, {'Content-Type' => 'text/html'}, ["<html><body><h1>500 Internal Server Error</h1></body></html>"]]
16
16
  ensure
17
17
  headers = result[1]
18
18
  headers["X-Logjam-Request-Id"] = request.id
@@ -5,11 +5,19 @@ module LogjamAgent
5
5
  def initialize
6
6
  @hostname = LogjamAgent.hostname
7
7
  @app_name = "rails"
8
- @attributes = []
9
8
  @newline = ActiveSupport::VERSION::STRING < "4.0" ? "" : "\n"
10
9
  end
11
10
 
12
- attr_accessor :attributes
11
+ def attributes=(attributes)
12
+ Thread.current.thread_variable_set(:__logjam_formatter_attributes__, attributes)
13
+ end
14
+
15
+ def attributes
16
+ unless attributes = Thread.current.thread_variable_get(:__logjam_formatter_attributes__)
17
+ attributes = Thread.current.thread_variable_set(:__logjam_formatter_attributes__, [])
18
+ end
19
+ attributes
20
+ end
13
21
 
14
22
  SEV_LABEL = Logger::SEV_LABEL.map{|sev| "%-5s" % sev}
15
23
 
@@ -42,19 +50,19 @@ module LogjamAgent
42
50
  end
43
51
 
44
52
  def render_attributes
45
- @attributes.map{|key, value| " #{key}[#{value}]"}.join
53
+ attributes.map{|key, value| " #{key}[#{value}]"}.join
46
54
  end
47
55
 
48
56
  def set_attribute(name, value)
49
- if attribute = @attributes.detect{|n,v| n == name}
57
+ if attribute = attributes.detect{|n,v| n == name}
50
58
  attribute[1] = value
51
59
  else
52
- @attributes << [name, value]
60
+ attributes << [name, value]
53
61
  end
54
62
  end
55
63
 
56
64
  def reset_attributes
57
- @attributes = []
65
+ self.attributes = []
58
66
  end
59
67
  end
60
68
  end
@@ -1,3 +1,3 @@
1
1
  module LogjamAgent
2
- VERSION = "0.29.6"
2
+ VERSION = "0.30.0"
3
3
  end
@@ -11,8 +11,6 @@ Gem::Specification.new do |s|
11
11
  s.summary = %q{Logjam client library to be used with logjam}
12
12
  s.description = %q{Logjam logger and request information forwarding}
13
13
 
14
- s.rubyforge_project = "logjam_agent"
15
-
16
14
  s.files = `git ls-files`.split("\n")
17
15
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
16
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
@@ -1,11 +1,11 @@
1
1
  require 'minitest/autorun'
2
2
  require 'minitest/unit'
3
3
  require 'minitest/pride' if ENV['RAINBOW_COLORED_TESTS'] == "1" && $stdout.tty?
4
- require 'mocha/setup'
5
-
6
- require_relative "../lib/logjam_agent"
4
+ require 'mocha/minitest'
7
5
 
8
6
  class MiniTest::Test
9
7
  require "active_support/testing/declarative"
10
8
  extend ActiveSupport::Testing::Declarative
11
9
  end
10
+
11
+ require_relative "../lib/logjam_agent"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logjam_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.29.6
4
+ version: 0.30.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Kaes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-22 00:00:00.000000000 Z
11
+ date: 2020-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake