yell-adapters-gelf 0.12.0 → 0.13.4

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -2,3 +2,11 @@ source "http://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in yell-adapters-gelf.gemspec
4
4
  gemspec
5
+
6
+ group :development, :test do
7
+ gem "rake"
8
+
9
+ gem "rspec"
10
+ gem "rr"
11
+ end
12
+
data/README.md CHANGED
@@ -28,39 +28,65 @@ gem "yell-adapters-gelf"
28
28
 
29
29
  ## Usage
30
30
 
31
- After you set-up Graylog2 accordingly, you may use the Gelf adapter just like
32
- any other.
31
+ After you set-up [Graylog2](http://www.graylog2.org) accordingly,
32
+ you may use the Gelf adapter just like any other.
33
33
 
34
34
  ```ruby
35
35
  logger = Yell.new :gelf
36
36
 
37
- logger.info "Hello World"
38
- # Check your Graylog2 web server for the received message.
37
+ # or alternatively with the block syntax
38
+ logger = Yell.new do |l|
39
+ l.adapter :gelf
40
+ end
41
+
42
+ logger.info 'Hello World!'
39
43
  ```
40
44
 
41
- Or alternatively with the block syntax:
45
+ Now check your Graylog2 web server for the received message. By default,
46
+ the gelf adapter will send the following information to Graylog2:
47
+
48
+ `facility`: The GELF facility (default: 'yell')
49
+ `level`: The current log level
50
+ `timestamp`: The time when the log event occured
51
+ `host`: The current hostname
52
+ `file`: The name of the file where the log event occured
53
+ `line`: The line in the file where the log event occured
54
+ `_method`: The method where the log event occured
55
+ `_pid`: The PID of your current process
56
+
57
+
58
+ ### Example: Running with a different GELF facility
42
59
 
43
60
  ```ruby
61
+ logger = Yell.new :gelf, :facility => 'my own facility'
62
+
63
+ # or with the block syntax
44
64
  logger = Yell.new do |l|
45
- l.adapter :gelf
65
+ l.adapter :gelf, :facility => 'my own facility'
46
66
  end
47
-
48
- logger.info 'Hello World!'
49
67
  ```
50
68
 
51
- If you are running Graylog2 on a different server or port, you can pass those
52
- options to the adapter:
69
+ ### Example: Running Graylog2 on a different host or port
53
70
 
54
71
  ```ruby
55
- logger = Yell.new :gelf, :host => 'hostname', :port => 1234
72
+ logger = Yell.new :gelf, :host => '127.0.0.1', :port => 1234
56
73
 
57
- # Or with the block syntax
74
+ # or with the block syntax
58
75
  logger = Yell.new do |l|
59
- l.adapter :gelf, :host => 'hostname', :port => 1234
76
+ l.adapter :gelf, :host => '127.0.0.1', :port => 1234
60
77
  end
61
78
 
62
79
  logger.info 'Hello World!'
63
80
  ```
64
81
 
82
+ ### Example: Passing additional keys to the adapter
83
+
84
+ ```ruby
85
+ logger = Yell.new :gelf
86
+
87
+ logger.info "Hello World", "_thread_id" => Thread.current.object_id,
88
+ "_current_user_id" => current_user.id
89
+ ```
90
+
65
91
  Copyright © 2012 Rudolf Schmidt, released under the MIT license
66
92
 
@@ -2,12 +2,10 @@
2
2
 
3
3
  module Yell #:nodoc:
4
4
  module Adapters #:nodoc:
5
-
6
5
  class Gelf
7
- VERSION = "0.12.0"
6
+ VERSION = "0.13.0"
8
7
 
9
8
  end
10
-
11
9
  end
12
10
  end
13
11
 
@@ -1,11 +1,10 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
3
  $:.push File.expand_path("../lib", __FILE__)
4
- require "yell/adapters/gelf/version"
5
4
 
6
5
  Gem::Specification.new do |s|
7
6
  s.name = "yell-adapters-gelf"
8
- s.version = Yell::Adapters::Gelf::VERSION
7
+ s.version = "0.13.4"
9
8
  s.authors = ["Rudolf Schmidt"]
10
9
 
11
10
  s.homepage = "http://rubygems.org/gems/yell"
@@ -14,15 +13,13 @@ Gem::Specification.new do |s|
14
13
 
15
14
  s.rubyforge_project = "yell"
16
15
 
17
- s.files = `git ls-files`.split("\n")
18
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
16
+ s.files = `git ls-files`.split($\)
17
+ s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
18
+ s.test_files = s.files.grep(%r{^(test|spec|features)/})
19
+
20
20
  s.require_paths = ["lib"]
21
21
 
22
- s.add_runtime_dependency "yell", ">= 0.12.0"
22
+ s.add_runtime_dependency "yell", ">= 0.13.4"
23
23
  s.add_runtime_dependency "json"
24
-
25
- s.add_development_dependency "rspec"
26
- s.add_development_dependency "rr"
27
24
  end
28
25
 
metadata CHANGED
@@ -1,123 +1,88 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: yell-adapters-gelf
3
- version: !ruby/object:Gem::Version
4
- version: 0.12.0
3
+ version: !ruby/object:Gem::Version
5
4
  prerelease:
5
+ version: 0.13.4
6
6
  platform: ruby
7
- authors:
8
- - Rudolf Schmidt
7
+ authors:
8
+ - Rudolf Schmidt
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-06 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: yell
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
21
- version: 0.12.0
22
- type: :runtime
23
- prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: 0.12.0
30
- - !ruby/object:Gem::Dependency
31
- name: json
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ! '>='
36
- - !ruby/object:Gem::Version
37
- version: '0'
38
- type: :runtime
39
- prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: '0'
46
- - !ruby/object:Gem::Dependency
47
- name: rspec
48
- requirement: !ruby/object:Gem::Requirement
49
- none: false
50
- requirements:
51
- - - ! '>='
52
- - !ruby/object:Gem::Version
53
- version: '0'
54
- type: :development
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- - !ruby/object:Gem::Dependency
63
- name: rr
64
- requirement: !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - ! '>='
68
- - !ruby/object:Gem::Version
69
- version: '0'
70
- type: :development
71
- prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
77
- version: '0'
12
+
13
+ date: 2012-09-14 00:00:00 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: yell
17
+ prerelease: false
18
+ requirement: &id001 !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 0.13.4
24
+ type: :runtime
25
+ version_requirements: *id001
26
+ - !ruby/object:Gem::Dependency
27
+ name: json
28
+ prerelease: false
29
+ requirement: &id002 !ruby/object:Gem::Requirement
30
+ none: false
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: "0"
35
+ type: :runtime
36
+ version_requirements: *id002
78
37
  description: Graylog2 adapter for Yell
79
38
  email:
80
39
  executables: []
40
+
81
41
  extensions: []
42
+
82
43
  extra_rdoc_files: []
83
- files:
84
- - .gitignore
85
- - .travis.yml
86
- - Gemfile
87
- - LICENSE.txt
88
- - README.md
89
- - Rakefile
90
- - lib/yell-adapters-gelf.rb
91
- - lib/yell/adapters/gelf.rb
92
- - lib/yell/adapters/gelf/version.rb
93
- - spec/spec_helper.rb
94
- - spec/yell/adapters/gelf_spec.rb
95
- - yell-adapters-gelf.gemspec
44
+
45
+ files:
46
+ - .gitignore
47
+ - .travis.yml
48
+ - Gemfile
49
+ - LICENSE.txt
50
+ - README.md
51
+ - Rakefile
52
+ - lib/yell-adapters-gelf.rb
53
+ - lib/yell/adapters/gelf.rb
54
+ - lib/yell/adapters/gelf/version.rb
55
+ - spec/spec_helper.rb
56
+ - spec/yell/adapters/gelf_spec.rb
57
+ - yell-adapters-gelf.gemspec
96
58
  homepage: http://rubygems.org/gems/yell
97
59
  licenses: []
60
+
98
61
  post_install_message:
99
62
  rdoc_options: []
100
- require_paths:
101
- - lib
102
- required_ruby_version: !ruby/object:Gem::Requirement
63
+
64
+ require_paths:
65
+ - lib
66
+ required_ruby_version: !ruby/object:Gem::Requirement
103
67
  none: false
104
- requirements:
105
- - - ! '>='
106
- - !ruby/object:Gem::Version
107
- version: '0'
108
- required_rubygems_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: "0"
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
109
73
  none: false
110
- requirements:
111
- - - ! '>='
112
- - !ruby/object:Gem::Version
113
- version: '0'
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: "0"
114
78
  requirements: []
79
+
115
80
  rubyforge_project: yell
116
- rubygems_version: 1.8.23
81
+ rubygems_version: 1.8.15
117
82
  signing_key:
118
83
  specification_version: 3
119
84
  summary: Yell - Your Extensible Logging Library
120
- test_files:
121
- - spec/spec_helper.rb
122
- - spec/yell/adapters/gelf_spec.rb
85
+ test_files:
86
+ - spec/spec_helper.rb
87
+ - spec/yell/adapters/gelf_spec.rb
123
88
  has_rdoc: