gelf_redux 3.1.1 → 3.2.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 +4 -4
- data/README.md +3 -2
- data/gelf.gemspec +6 -3
- data/lib/gelf/notifier.rb +9 -0
- data/lib/gelf.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a043e357efea39c53c0f6fa35fae048ff27b8832099d7cfd48b3e88c6083d4c2
|
4
|
+
data.tar.gz: 93c9d1d9d2ba69be361b8a7113f792d2a4663455438f0b613db776a5809fb7f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4a3f550556b174a5970fd26c682f9d0107ad83e6f78fb3b6a00b6648cde8dae04c4c6c122d0dd15111ed64dc5d37e93dffcf1840070e18f7767ca805fd03c34
|
7
|
+
data.tar.gz: 31ec48b4986ae8b6328aaff7671908138e8570a45048d061a3c4c73a19c91dd5ed16167cea6589e7068b681da5a150a02b65ebe5bea51fde97407f676b620f9f
|
data/README.md
CHANGED
@@ -8,7 +8,7 @@ of the original project because we wanted to keep all of the projects and mainta
|
|
8
8
|
## Versioning
|
9
9
|
|
10
10
|
- 3.1.1 is the latest original gelf-rb version ()
|
11
|
-
- 3.2.
|
11
|
+
- 3.2.1 is the first http(s) supporting version from here https://github.com/christianrolle/gelf-rb
|
12
12
|
- 4.0.0 we do start from here with our versioning, improvements and updates
|
13
13
|
|
14
14
|
|
@@ -16,7 +16,7 @@ of the original project because we wanted to keep all of the projects and mainta
|
|
16
16
|
## Usage
|
17
17
|
### Gelf::Notifier
|
18
18
|
|
19
|
-
This allows you to
|
19
|
+
This allows you to send arbitary messages via UDP to Graylog.
|
20
20
|
|
21
21
|
n = GELF::Notifier.new("localhost", 12201)
|
22
22
|
|
@@ -60,6 +60,7 @@ Since it's compatible with the Logger interface, you can also use it in your Rai
|
|
60
60
|
* Fork the project.
|
61
61
|
* Make your feature addition or bug fix.
|
62
62
|
* Add tests for it. This is important so I don't break it in a future version unintentionally.
|
63
|
+
* Run the tests with `bundle exec rake`
|
63
64
|
* Commit, do not mess with rakefile, version, or history.
|
64
65
|
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
65
66
|
* Send me a pull request. Bonus points for topic branches.
|
data/gelf.gemspec
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "gelf_redux"
|
3
|
-
s.version = "3.
|
3
|
+
s.version = "3.2.1"
|
4
4
|
|
5
5
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
6
6
|
s.required_ruby_version = ">= 1.9"
|
7
7
|
s.require_paths = ["lib"]
|
8
|
-
s.authors = ["Alexey Palazhchenko", "Lennart Koopmann", "Zac Sprackett", "Marcus Ilgner", "Sebastian Seidel"]
|
8
|
+
s.authors = ["Alexey Palazhchenko", "Lennart Koopmann", "Zac Sprackett", "Marcus Ilgner", "Sebastian Seidel", "Christian Rolle"]
|
9
9
|
s.date = "2023-06-19"
|
10
|
-
s.description = "Library to send GELF messages to Graylog logging server. Supports plain-text, GELF messages and exceptions via UDP and
|
10
|
+
s.description = "Library to send GELF messages to Graylog logging server. Supports plain-text, GELF messages and exceptions via UDP, TCP and HTTPS"
|
11
11
|
s.email = "admins@manet-marketing.de"
|
12
12
|
s.extra_rdoc_files = [
|
13
13
|
"LICENSE",
|
@@ -46,6 +46,9 @@ Gem::Specification.new do |s|
|
|
46
46
|
if s.respond_to? :specification_version then
|
47
47
|
s.specification_version = 4
|
48
48
|
|
49
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('3.2.0') then
|
50
|
+
s.add_development_dependency(%q<typhoeus>, ["~> 1.4.0"])
|
51
|
+
end
|
49
52
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
50
53
|
s.add_development_dependency(%q<shoulda>, ["~> 2.11.3"])
|
51
54
|
s.add_development_dependency(%q<rack>, ["< 2.0"])
|
data/lib/gelf/notifier.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'gelf/transport/udp'
|
2
2
|
require 'gelf/transport/tcp'
|
3
3
|
require 'gelf/transport/tcp_tls'
|
4
|
+
require 'gelf/transport/https'
|
4
5
|
|
5
6
|
# replace JSON and #to_json with Yajl if available
|
6
7
|
begin
|
@@ -135,6 +136,8 @@ module GELF
|
|
135
136
|
private
|
136
137
|
|
137
138
|
def create_sender(host, port)
|
139
|
+
return create_https(host, port) if default_options['protocol'] == GELF::Protocol::HTTPS
|
140
|
+
|
138
141
|
addresses = [[host, port]]
|
139
142
|
if default_options['protocol'] == GELF::Protocol::TCP
|
140
143
|
if default_options.key?('tls')
|
@@ -148,6 +151,10 @@ module GELF
|
|
148
151
|
end
|
149
152
|
end
|
150
153
|
|
154
|
+
def create_https(host, port)
|
155
|
+
GELF::Transport::HTTPS.new host, port: port, path: default_options.delete('path')
|
156
|
+
end
|
157
|
+
|
151
158
|
def notify_with_level(message_level, *args)
|
152
159
|
notify_with_level!(message_level, *args)
|
153
160
|
rescue SocketError, SystemCallError
|
@@ -161,6 +168,8 @@ module GELF
|
|
161
168
|
hash = extract_hash(*args)
|
162
169
|
hash['level'] = message_level unless message_level.nil?
|
163
170
|
if hash['level'] >= level
|
171
|
+
return @sender.transfer(hash) if default_options['protocol'] == GELF::Protocol::HTTPS
|
172
|
+
|
164
173
|
if default_options['protocol'] == GELF::Protocol::TCP
|
165
174
|
validate_hash(hash)
|
166
175
|
@sender.send(hash.to_json + "\0")
|
data/lib/gelf.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gelf_redux
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexey Palazhchenko
|
@@ -9,6 +9,7 @@ authors:
|
|
9
9
|
- Zac Sprackett
|
10
10
|
- Marcus Ilgner
|
11
11
|
- Sebastian Seidel
|
12
|
+
- Christian Rolle
|
12
13
|
autorequire:
|
13
14
|
bindir: bin
|
14
15
|
cert_chain: []
|
@@ -85,7 +86,7 @@ dependencies:
|
|
85
86
|
- !ruby/object:Gem::Version
|
86
87
|
version: '0'
|
87
88
|
description: Library to send GELF messages to Graylog logging server. Supports plain-text,
|
88
|
-
GELF messages and exceptions via UDP and
|
89
|
+
GELF messages and exceptions via UDP, TCP and HTTPS
|
89
90
|
email: admins@manet-marketing.de
|
90
91
|
executables: []
|
91
92
|
extensions: []
|