log4r-fluent 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/log4r/fluent_outputter.rb +4 -3
- metadata +4 -4
@@ -4,19 +4,20 @@ require 'fluent-logger'
|
|
4
4
|
|
5
5
|
module Log4r
|
6
6
|
class FluentOutputter < Log4r::Outputter
|
7
|
-
VERSION = "0.0.
|
7
|
+
VERSION = "0.0.3"
|
8
8
|
attr_accessor :tag
|
9
|
+
attr_accessor :log
|
9
10
|
|
10
11
|
def initialize(_name, hash={})
|
11
12
|
super(_name, hash)
|
12
13
|
@tag = hash[:tag] || hash["tag"] || 'test'
|
13
14
|
host = hash[:host] || hash["host"] || 'localhost'
|
14
15
|
port = hash[:port] || hash["port"] || 24224
|
15
|
-
|
16
|
+
@log = Fluent::Logger::FluentLogger.new(nil, host: host, port: port.to_i)
|
16
17
|
end
|
17
18
|
|
18
19
|
def canonical_log(logevent)
|
19
|
-
|
20
|
+
@log.post(@tag, {l: logevent.level, d: logevent.data})
|
20
21
|
end
|
21
22
|
end
|
22
23
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: log4r-fluent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
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-10-
|
12
|
+
date: 2012-10-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: log4r
|
@@ -74,7 +74,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
74
74
|
version: '0'
|
75
75
|
segments:
|
76
76
|
- 0
|
77
|
-
hash: -
|
77
|
+
hash: -1022015731560684338
|
78
78
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
79
79
|
none: false
|
80
80
|
requirements:
|
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
83
|
version: '0'
|
84
84
|
segments:
|
85
85
|
- 0
|
86
|
-
hash: -
|
86
|
+
hash: -1022015731560684338
|
87
87
|
requirements: []
|
88
88
|
rubyforge_project:
|
89
89
|
rubygems_version: 1.8.24
|