log4r-logdna 0.3.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/log4r-logdna/logdna_outputter.rb +9 -6
- data/lib/log4r-logdna/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f7d35c368b31a19e99b463c1b91079f937e5504
|
4
|
+
data.tar.gz: 52409e63224cbee760c82b29e1590fd102f73f39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2eed619f3454716db8a5e8528d6a059c0e5e392d49db720b5921ce4feec56cbe5f16dd96e86d38a5d6ecd0eea710a8328820a8bdbba96ce310671a0d503b4b0
|
7
|
+
data.tar.gz: 3391b0f20bd27e56a85ba411e8f518ef66bd2817a80453b9de799c7857f3b965ae01e22dc580cea66f56227b3fc676b4f033c7f74228725831015297a32aa75f
|
@@ -23,7 +23,7 @@ module Log4r
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def format_attribute(value)
|
26
|
-
value
|
26
|
+
value
|
27
27
|
end
|
28
28
|
|
29
29
|
private
|
@@ -31,7 +31,8 @@ module Log4r
|
|
31
31
|
def canonical_log(logevent)
|
32
32
|
|
33
33
|
msg = {
|
34
|
-
:level => Log4r::LNAMES[logevent.level]
|
34
|
+
:level => Log4r::LNAMES[logevent.level],
|
35
|
+
:logger => logevent.fullname
|
35
36
|
}
|
36
37
|
|
37
38
|
if logevent.data.respond_to?(:backtrace)
|
@@ -55,7 +56,7 @@ module Log4r
|
|
55
56
|
gdc = Log4r::GDC.get
|
56
57
|
if gdc && gdc != $0 && @gdc_key
|
57
58
|
begin
|
58
|
-
msg["
|
59
|
+
msg["#{@gdc_key}"] = format_attribute(gdc)
|
59
60
|
rescue
|
60
61
|
end
|
61
62
|
end
|
@@ -63,7 +64,7 @@ module Log4r
|
|
63
64
|
if Log4r::NDC.get_depth > 0 && @ndc_prefix
|
64
65
|
Log4r::NDC.clone_stack.each_with_index do |x, i|
|
65
66
|
begin
|
66
|
-
msg["
|
67
|
+
msg["#{@ndc_prefix}#{i}"] = format_attribute(x)
|
67
68
|
rescue
|
68
69
|
end
|
69
70
|
end
|
@@ -73,7 +74,7 @@ module Log4r
|
|
73
74
|
if mdc && mdc.size > 0 && @mdc_prefix
|
74
75
|
mdc.each do |k, v|
|
75
76
|
begin
|
76
|
-
msg["
|
77
|
+
msg["#{@mdc_prefix}#{k}"] = format_attribute(v)
|
77
78
|
rescue
|
78
79
|
end
|
79
80
|
end
|
@@ -92,7 +93,9 @@ module Log4r
|
|
92
93
|
|
93
94
|
msg[:message] = format(logevent) unless msg[:message]
|
94
95
|
|
95
|
-
|
96
|
+
app = logevent.fullname.split(/::/)[0]
|
97
|
+
|
98
|
+
@client.tobuffer(msg.to_json, {:app => app})
|
96
99
|
rescue => err
|
97
100
|
puts "LogDNA logger. Could not send message: " + err.message
|
98
101
|
puts err.backtrace.join("\n") if err.backtrace
|
data/lib/log4r-logdna/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: log4r-logdna
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Machado
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: log4r
|