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 +4 -4
- data/lib/logjam_agent.rb +6 -1
- data/lib/logjam_agent/middleware.rb +1 -1
- data/lib/logjam_agent/syslog_like_formatter.rb +14 -6
- data/lib/logjam_agent/version.rb +1 -1
- data/logjam_agent.gemspec +0 -2
- data/test/test_helper.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b351167b038a91fd392f94501012260ee84319fb6035b9bf5e35811d50c885b1
|
4
|
+
data.tar.gz: 838094a8022bf451422bb66219924737c5d32684c7a6194c979554f101b9071e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78a136746231e26e873fcddf04740c0d748c29823e9db6fc9eabb43e9fd26cb10ec92f59eb687b70854f20a8fe918476287c171b3eca48f5006226c712ef0fb2
|
7
|
+
data.tar.gz: 84f8e23f8fbbc07e319e8cb928945a1c4f3198502d45a8e9a22e8dc4c9f9184f9283811c24ef40587c41d25badb6bfa3eceea7ca43b2468d3b15c1d49cb24393
|
data/lib/logjam_agent.rb
CHANGED
@@ -109,7 +109,12 @@ module LogjamAgent
|
|
109
109
|
self.obfuscated_cookies = [/_session\z/]
|
110
110
|
|
111
111
|
def self.cookie_obfuscator
|
112
|
-
@cookie_obfuscator ||=
|
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
|
-
|
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
|
-
|
53
|
+
attributes.map{|key, value| " #{key}[#{value}]"}.join
|
46
54
|
end
|
47
55
|
|
48
56
|
def set_attribute(name, value)
|
49
|
-
if attribute =
|
57
|
+
if attribute = attributes.detect{|n,v| n == name}
|
50
58
|
attribute[1] = value
|
51
59
|
else
|
52
|
-
|
60
|
+
attributes << [name, value]
|
53
61
|
end
|
54
62
|
end
|
55
63
|
|
56
64
|
def reset_attributes
|
57
|
-
|
65
|
+
self.attributes = []
|
58
66
|
end
|
59
67
|
end
|
60
68
|
end
|
data/lib/logjam_agent/version.rb
CHANGED
data/logjam_agent.gemspec
CHANGED
@@ -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) }
|
data/test/test_helper.rb
CHANGED
@@ -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/
|
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.
|
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:
|
11
|
+
date: 2020-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|