rails-graylogger 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/lib/rails-graylogger/message.rb +9 -5
- data/lib/rails-graylogger/version.rb +1 -1
- data/spec/rails-graylogger/message_spec.rb +6 -0
- metadata +2 -3
- data/Gemfile.lock +0 -48
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 279bc568e2418b58a0f4f698710667247713aecf
|
4
|
+
data.tar.gz: 91eccafa793d098055aa297c85ff5ceccfb5a69e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2379f5d90792bdb95f54e42e62c9df8c765e18dd686dbb09b41c9009c6a3854efabc67f4699ce7f92d17623fcfe4a2dbc59b892ec100a68b354ef141e5f3e378
|
7
|
+
data.tar.gz: a3957f935b11597cd739cf821192a2a0551a9c92cc1269093c472e681e01a54be485546e972f245c95334b9094668a94ee87c5e340e15ecfc3fe199cdbc7fe0a
|
data/.gitignore
CHANGED
@@ -40,7 +40,7 @@ module RailsGraylogger
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def process_extra_fields(payload)
|
43
|
-
process_exception_data(payload.delete(:exception))
|
43
|
+
process_exception_data(payload.delete(:exception))
|
44
44
|
|
45
45
|
payload.each do |key, value|
|
46
46
|
@extra_fields["_#{key}"] = formatted_value(value) if valid_key?(key)
|
@@ -62,13 +62,17 @@ module RailsGraylogger
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def level_from_status(status)
|
65
|
-
status < 400
|
65
|
+
if status.is_a?(Numeric) && status < 400
|
66
|
+
GELF::Levels::INFO
|
67
|
+
else
|
68
|
+
GELF::Levels::ERROR
|
69
|
+
end
|
66
70
|
end
|
67
71
|
|
68
72
|
def process_exception_data(exception)
|
69
|
-
exception.
|
70
|
-
|
71
|
-
|
73
|
+
return unless exception.is_a?(Array)
|
74
|
+
@extra_fields["_exception_class"] = exception.first.to_s
|
75
|
+
@extra_fields["_exception_message"] = exception.last.to_s
|
72
76
|
end
|
73
77
|
end
|
74
78
|
end
|
@@ -20,5 +20,11 @@ describe RailsGraylogger::Message do
|
|
20
20
|
@msg.process_extra_fields({ test: { foo: "bar" } })
|
21
21
|
expect(@msg.extra_fields).to eq({ "_test" => "{:foo=>\"bar\"}" })
|
22
22
|
end
|
23
|
+
|
24
|
+
it "should process the exception data" do
|
25
|
+
exception = [ RuntimeError, "test" ]
|
26
|
+
@msg.process_extra_fields({ exception: exception })
|
27
|
+
expect(@msg.extra_fields).to eq({ "_exception_class" => "RuntimeError", "_exception_message" => "test" })
|
28
|
+
end
|
23
29
|
end
|
24
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-graylogger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tuomas Silen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gelf
|
@@ -89,7 +89,6 @@ extra_rdoc_files: []
|
|
89
89
|
files:
|
90
90
|
- ".gitignore"
|
91
91
|
- Gemfile
|
92
|
-
- Gemfile.lock
|
93
92
|
- README.md
|
94
93
|
- Rakefile
|
95
94
|
- lib/rails-graylogger.rb
|
data/Gemfile.lock
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
rails-graylogger (0.1.0)
|
5
|
-
activesupport (~> 4)
|
6
|
-
gelf (~> 1.4.0)
|
7
|
-
request_store (~> 1.0)
|
8
|
-
|
9
|
-
GEM
|
10
|
-
remote: https://rubygems.org/
|
11
|
-
specs:
|
12
|
-
activesupport (4.2.0)
|
13
|
-
i18n (~> 0.7)
|
14
|
-
json (~> 1.7, >= 1.7.7)
|
15
|
-
minitest (~> 5.1)
|
16
|
-
thread_safe (~> 0.3, >= 0.3.4)
|
17
|
-
tzinfo (~> 1.1)
|
18
|
-
diff-lcs (1.2.5)
|
19
|
-
gelf (1.4.0)
|
20
|
-
json
|
21
|
-
i18n (0.7.0)
|
22
|
-
json (1.8.2)
|
23
|
-
minitest (5.5.1)
|
24
|
-
rake (10.4.2)
|
25
|
-
request_store (1.1.0)
|
26
|
-
rspec (3.1.0)
|
27
|
-
rspec-core (~> 3.1.0)
|
28
|
-
rspec-expectations (~> 3.1.0)
|
29
|
-
rspec-mocks (~> 3.1.0)
|
30
|
-
rspec-core (3.1.7)
|
31
|
-
rspec-support (~> 3.1.0)
|
32
|
-
rspec-expectations (3.1.2)
|
33
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
34
|
-
rspec-support (~> 3.1.0)
|
35
|
-
rspec-mocks (3.1.3)
|
36
|
-
rspec-support (~> 3.1.0)
|
37
|
-
rspec-support (3.1.2)
|
38
|
-
thread_safe (0.3.4)
|
39
|
-
tzinfo (1.2.2)
|
40
|
-
thread_safe (~> 0.1)
|
41
|
-
|
42
|
-
PLATFORMS
|
43
|
-
ruby
|
44
|
-
|
45
|
-
DEPENDENCIES
|
46
|
-
rails-graylogger!
|
47
|
-
rake
|
48
|
-
rspec (~> 3)
|