sidekiq-gelf 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +34 -0
- data/LICENSE +21 -0
- data/README.md +12 -0
- data/Rakefile +1 -0
- data/lib/sidekiq-gelf/formatter.rb +15 -0
- data/lib/sidekiq-gelf.rb +18 -0
- data/sidekiq-gelf.gemspec +26 -0
- metadata +95 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 44b84657c8a5dbd62d1f32b95f8053232acdd44c
|
4
|
+
data.tar.gz: 7b6b59116b7efd133d9b6e95bd4fcb3dfd9b34d8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 234c1d1afb67083ae004ce7f4daa91343fc33ae429fb1fec4e5ce64afab0d4b9640a847fdccd2050f087e3192b7ce512a662723a31685ccedb511bd1fc866c05
|
7
|
+
data.tar.gz: 03c71bc5c0fbd3913c085f2a88435b943d1421da6711356f8f803361165ca31b11befe6b9bfd8d41c6c04f79a38df4a6d72a2ba1de88c58ad5144a05374e0528
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
sidekiq-gelf (0.0.1)
|
5
|
+
gelf (~> 1.4)
|
6
|
+
sidekiq (~> 3)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
celluloid (0.15.2)
|
12
|
+
timers (~> 1.1.0)
|
13
|
+
connection_pool (2.0.0)
|
14
|
+
gelf (1.4.0)
|
15
|
+
json
|
16
|
+
json (1.8.1)
|
17
|
+
rake (10.3.1)
|
18
|
+
redis (3.0.7)
|
19
|
+
redis-namespace (1.4.1)
|
20
|
+
redis (~> 3.0.4)
|
21
|
+
sidekiq (3.0.0)
|
22
|
+
celluloid (>= 0.15.2)
|
23
|
+
connection_pool (>= 2.0.0)
|
24
|
+
json
|
25
|
+
redis (>= 3.0.6)
|
26
|
+
redis-namespace (>= 1.3.1)
|
27
|
+
timers (1.1.0)
|
28
|
+
|
29
|
+
PLATFORMS
|
30
|
+
ruby
|
31
|
+
|
32
|
+
DEPENDENCIES
|
33
|
+
rake
|
34
|
+
sidekiq-gelf!
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2014 Ryan LeFevre
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# sidekiq-gelf
|
2
|
+
|
3
|
+
Enables Sidekiq logging to a GELF-supported server, such as Graylog2.
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
``` ruby
|
8
|
+
# Replace the sidekiq logger with gelf-rb and set the formatter
|
9
|
+
# to include important logging information.
|
10
|
+
# These arguments are passed through to gelf-rb.
|
11
|
+
Sidekiq::Logging::GELF.hook!('127.0.0.1', 12201, 'LAN', facility: "my-application")
|
12
|
+
```
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Sidekiq
|
2
|
+
module Logging
|
3
|
+
module GELF
|
4
|
+
class Formatter < Logger::Formatter
|
5
|
+
def call(severity, time, facility, message)
|
6
|
+
message.merge({
|
7
|
+
pid: Process.pid,
|
8
|
+
tid: Thread.current.object_id.to_s(36),
|
9
|
+
context: Thread.current[:sidekiq_context]
|
10
|
+
})
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
data/lib/sidekiq-gelf.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'logger'
|
2
|
+
require 'gelf'
|
3
|
+
require 'sidekiq'
|
4
|
+
|
5
|
+
require 'sidekiq-gelf/formatter'
|
6
|
+
|
7
|
+
module Sidekiq
|
8
|
+
module Logging
|
9
|
+
module GELF
|
10
|
+
extend self
|
11
|
+
|
12
|
+
def hook!(*args)
|
13
|
+
Sidekiq::Logging.logger = ::GELF::Logger.new(*args)
|
14
|
+
Sidekiq::Logging.logger.formatter = Formatter.new
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = "sidekiq-gelf"
|
5
|
+
s.version = "0.0.1"
|
6
|
+
|
7
|
+
s.author = "Ryan LeFevre"
|
8
|
+
s.date = "2014-04-21"
|
9
|
+
s.description = "GELF logging for Sidekiq"
|
10
|
+
s.email = "ryan@layervault.com"
|
11
|
+
s.extra_rdoc_files = [
|
12
|
+
"LICENSE",
|
13
|
+
"README.md"
|
14
|
+
]
|
15
|
+
s.files = `git ls-files`.split($/)
|
16
|
+
s.homepage = "http://github.com/layervault/sidekiq-gelf-rb"
|
17
|
+
s.require_paths = ["lib"]
|
18
|
+
s.summary = "Format Sidekiq log messages for a GELF-supported logging server like Graylog2"
|
19
|
+
s.license = 'MIT'
|
20
|
+
|
21
|
+
s.add_dependency "gelf", '~> 1.4'
|
22
|
+
s.add_dependency "sidekiq", '~> 3'
|
23
|
+
|
24
|
+
s.add_development_dependency 'rake'
|
25
|
+
end
|
26
|
+
|
metadata
ADDED
@@ -0,0 +1,95 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sidekiq-gelf
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ryan LeFevre
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-04-21 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: gelf
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.4'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.4'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: sidekiq
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ~>
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description: GELF logging for Sidekiq
|
56
|
+
email: ryan@layervault.com
|
57
|
+
executables: []
|
58
|
+
extensions: []
|
59
|
+
extra_rdoc_files:
|
60
|
+
- LICENSE
|
61
|
+
- README.md
|
62
|
+
files:
|
63
|
+
- Gemfile
|
64
|
+
- Gemfile.lock
|
65
|
+
- LICENSE
|
66
|
+
- README.md
|
67
|
+
- Rakefile
|
68
|
+
- lib/sidekiq-gelf.rb
|
69
|
+
- lib/sidekiq-gelf/formatter.rb
|
70
|
+
- sidekiq-gelf.gemspec
|
71
|
+
homepage: http://github.com/layervault/sidekiq-gelf-rb
|
72
|
+
licenses:
|
73
|
+
- MIT
|
74
|
+
metadata: {}
|
75
|
+
post_install_message:
|
76
|
+
rdoc_options: []
|
77
|
+
require_paths:
|
78
|
+
- lib
|
79
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - '>='
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - '>='
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
requirements: []
|
90
|
+
rubyforge_project:
|
91
|
+
rubygems_version: 2.2.1
|
92
|
+
signing_key:
|
93
|
+
specification_version: 4
|
94
|
+
summary: Format Sidekiq log messages for a GELF-supported logging server like Graylog2
|
95
|
+
test_files: []
|