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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 84a0ba052d0d47e86acdd7acdbeced554ee18b2f
4
- data.tar.gz: acd2d877b46bf786ad6b36e6e422be408e505008
3
+ metadata.gz: 3f7d35c368b31a19e99b463c1b91079f937e5504
4
+ data.tar.gz: 52409e63224cbee760c82b29e1590fd102f73f39
5
5
  SHA512:
6
- metadata.gz: 91fd882cddd984df9548a7d195c211d4055d7f8a8407a7b99d062f8b97511571cf76e1f232cea201252d59fea8c3b1e41379253ec144f0239111a65d1283231a
7
- data.tar.gz: 60208838b08c28df7e43e5d60267311f38a711c9ab0cf5daebb450763dcad2321c9941c2e5a3ac60db1ab664175245854a66e08b71641c2b98b825f31bcc9afc
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.inspect
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["_#{@gdc_key}"] = format_attribute(gdc)
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["_#{@ndc_prefix}#{i}"] = format_attribute(x)
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["_#{@mdc_prefix}#{k}"] = format_attribute(v)
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
- @client.tobuffer(msg.to_json, {:app => logevent.fullname})
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
@@ -1,5 +1,5 @@
1
1
  module Log4r
2
2
  module Logdna
3
- VERSION = "0.3.0"
3
+ VERSION = "0.6.0"
4
4
  end
5
5
  end
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.3.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-09 00:00:00.000000000 Z
11
+ date: 2017-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: log4r