fluent-plugin-airbrake-logger 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/fluent-plugin-airbrake-logger.gemspec +4 -4
- data/lib/fluent/plugin/out_airbrake_logger.rb +12 -11
- data/test/plugin/.keep +0 -0
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1490f1bf0c515799878049536f1cfda972f8cc2b
|
4
|
+
data.tar.gz: 86d57218a3e4e6575a916c5fcf4b50518d1c677f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2976f851bc615ad454e429a59cd0d352de60097834016919a3c1dcbb9bf756b3b8677d1e36f6f041ae25faf6efb5c1c90a63c1a8252216f47a0340ea16e06a1d
|
7
|
+
data.tar.gz: fdbca7e359179aec280affdf26ccae383af8750b95cdb1a36d4cf3079be39ab3330d1134c7a3186e2d2741cfca1d58db5fd1d8b40766bb59d005d119f15902ea
|
@@ -4,16 +4,16 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "fluent-plugin-airbrake-logger"
|
7
|
-
spec.version = "0.0.
|
7
|
+
spec.version = "0.0.2"
|
8
8
|
spec.authors = ["Shuichi Ohsawa"]
|
9
9
|
spec.email = ["ohsawa0515@gmail.com"]
|
10
10
|
|
11
|
-
spec.summary = %q{Output filter plugin to Airbrake(Errbit) by fluent-logger
|
12
|
-
spec.description = %q{Output filter plugin to Airbrake(Errbit) by fluent-logger
|
11
|
+
spec.summary = %q{Output filter plugin to Airbrake(Errbit) by fluent-logger}
|
12
|
+
spec.description = %q{Output filter plugin to Airbrake(Errbit) by fluent-logger}
|
13
13
|
spec.homepage = "https://github.com/ohsawa0515/fluent-plugin-airbrake-logger"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
|
-
spec.files = `git ls-files
|
16
|
+
spec.files = `git ls-files`.split($\)
|
17
17
|
spec.bindir = "exe"
|
18
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
19
|
spec.require_paths = ["lib"]
|
@@ -8,7 +8,7 @@ class Fluent::ErrbitGeesOutput < Fluent::Output
|
|
8
8
|
'WARNING' => 30,
|
9
9
|
'WARN' => 30,
|
10
10
|
'INFO' => 20,
|
11
|
-
'DEBUG' => 10
|
11
|
+
'DEBUG' => 10
|
12
12
|
}
|
13
13
|
|
14
14
|
config_param :api_key, :string, :default => nil
|
@@ -43,7 +43,7 @@ class Fluent::ErrbitGeesOutput < Fluent::Output
|
|
43
43
|
config_param :log_path, :string, :default => nil
|
44
44
|
|
45
45
|
def initialize
|
46
|
-
super
|
46
|
+
super
|
47
47
|
require 'airbrake'
|
48
48
|
end
|
49
49
|
|
@@ -51,9 +51,8 @@ class Fluent::ErrbitGeesOutput < Fluent::Output
|
|
51
51
|
super
|
52
52
|
|
53
53
|
Airbrake.configure do |config|
|
54
|
-
config.api_key = @api_key
|
55
54
|
config.host = @host
|
56
|
-
config.port = @port ? @port: (@secure ? 443: 80)
|
55
|
+
config.port = @port ? @port : (@secure ? 443 : 80)
|
57
56
|
config.secure = @secure
|
58
57
|
config.use_system_ssl_cert_chain = @use_system_ssl_cert_chain
|
59
58
|
config.http_open_timeout = @http_open_timeout if @http_open_timeout
|
@@ -82,18 +81,19 @@ class Fluent::ErrbitGeesOutput < Fluent::Output
|
|
82
81
|
@loglevel = LOGLEVEL_MAP[@loglevel.upcase]
|
83
82
|
end
|
84
83
|
|
85
|
-
def notification_needed(
|
84
|
+
def notification_needed(_tag, _time, record)
|
86
85
|
severity_map = LOGLEVEL_MAP[record['severity']]
|
87
|
-
|
86
|
+
|
87
|
+
record['severity'] ? severity_map >= @loglevel : false
|
88
88
|
end
|
89
89
|
|
90
90
|
def build_error_message(record)
|
91
91
|
error_message = record['error_message'] ? record['error_message'] : 'Notification'
|
92
|
-
|
92
|
+
"[#{record['severity']}] #{error_message}"
|
93
93
|
end
|
94
94
|
|
95
95
|
def build_error_backtrace(record)
|
96
|
-
return record['error_backtrace'] ? record['error_backtrace'] : record['backtrace']
|
96
|
+
return record['error_backtrace'] ? record['error_backtrace'] : (record['backtrace'] ? record['backtrace'] : "")
|
97
97
|
end
|
98
98
|
|
99
99
|
def emit(tag, es, chain)
|
@@ -101,15 +101,17 @@ class Fluent::ErrbitGeesOutput < Fluent::Output
|
|
101
101
|
|
102
102
|
next unless notification_needed(tag, time, record)
|
103
103
|
|
104
|
-
other_record = record.reject{|k,
|
104
|
+
other_record = record.reject {|k, _| %w(error_class error_backtrace error_message application_name service_name).include?(k) }
|
105
|
+
|
105
106
|
@notice = Airbrake::Notice.new(@aconf.merge(
|
107
|
+
:api_key => @api_key,
|
106
108
|
:error_class => record['error_class'],
|
107
109
|
:backtrace => build_error_backtrace(record),
|
108
110
|
:error_message => build_error_message(record),
|
109
111
|
:hostname => record['hostname'],
|
110
112
|
:component => record['application_name'],
|
111
113
|
:action => record['service_name'],
|
112
|
-
:cgi_data => other_record
|
114
|
+
:cgi_data => other_record
|
113
115
|
))
|
114
116
|
|
115
117
|
@sender.send_to_airbrake(@notice) if @notice
|
@@ -117,4 +119,3 @@ class Fluent::ErrbitGeesOutput < Fluent::Output
|
|
117
119
|
chain.next
|
118
120
|
end
|
119
121
|
end
|
120
|
-
|
data/test/plugin/.keep
ADDED
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-airbrake-logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shuichi Ohsawa
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -80,7 +80,7 @@ dependencies:
|
|
80
80
|
- - '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 4.3.0
|
83
|
-
description: Output filter plugin to Airbrake(Errbit) by fluent-logger
|
83
|
+
description: Output filter plugin to Airbrake(Errbit) by fluent-logger
|
84
84
|
email:
|
85
85
|
- ohsawa0515@gmail.com
|
86
86
|
executables: []
|
@@ -94,6 +94,7 @@ files:
|
|
94
94
|
- Rakefile
|
95
95
|
- fluent-plugin-airbrake-logger.gemspec
|
96
96
|
- lib/fluent/plugin/out_airbrake_logger.rb
|
97
|
+
- test/plugin/.keep
|
97
98
|
homepage: https://github.com/ohsawa0515/fluent-plugin-airbrake-logger
|
98
99
|
licenses:
|
99
100
|
- MIT
|
@@ -117,5 +118,5 @@ rubyforge_project:
|
|
117
118
|
rubygems_version: 2.0.14
|
118
119
|
signing_key:
|
119
120
|
specification_version: 4
|
120
|
-
summary: Output filter plugin to Airbrake(Errbit) by fluent-logger
|
121
|
+
summary: Output filter plugin to Airbrake(Errbit) by fluent-logger
|
121
122
|
test_files: []
|