logjam_agent 0.4.4 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
@@ -36,7 +36,7 @@ module LogjamAgent
|
|
36
36
|
|
37
37
|
def add(severity, message = nil, progname = nil, &block)
|
38
38
|
return if level > severity
|
39
|
-
request = self.request
|
39
|
+
request = self.request || Thread.main[:logjam_request]
|
40
40
|
if message.is_a?(Exception)
|
41
41
|
request.add_exception(message.class.to_s) if request
|
42
42
|
message = format_exception(message)
|
data/lib/logjam_agent/request.rb
CHANGED
@@ -12,6 +12,7 @@ module LogjamAgent
|
|
12
12
|
@lines = []
|
13
13
|
@id = UUID4R::uuid(1).gsub('-','')
|
14
14
|
@fields = initial_fields.merge(:request_id => @id, :host => LogjamAgent.hostname, :process_id => Process.pid, :lines => @lines)
|
15
|
+
@mutex = Mutex.new
|
15
16
|
end
|
16
17
|
|
17
18
|
def id
|
@@ -23,11 +24,15 @@ module LogjamAgent
|
|
23
24
|
end
|
24
25
|
|
25
26
|
def add_line(severity, timestamp, message)
|
26
|
-
@
|
27
|
+
@mutex.synchronize do
|
28
|
+
@lines << [severity, format_time(timestamp), message.strip]
|
29
|
+
end
|
27
30
|
end
|
28
31
|
|
29
32
|
def add_exception(exception)
|
30
|
-
|
33
|
+
@mutex.synchronize do
|
34
|
+
((@fields[:exceptions] ||= []) << exception).uniq!
|
35
|
+
end
|
31
36
|
end
|
32
37
|
|
33
38
|
def forward
|
data/lib/logjam_agent/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logjam_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-08-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|