logstash-input-log4j 2.0.1-java → 2.0.2-java
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/CHANGELOG.md +2 -0
- data/lib/logstash/inputs/log4j.rb +5 -1
- data/logstash-input-log4j.gemspec +1 -1
- data/spec/inputs/log4j_spec.rb +7 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcb395d5fc55f0c24ea2ea791a30428cfa9d297e
|
4
|
+
data.tar.gz: 620c01374174a2210ea969620b1627c6ef79fce6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4411ed31f75ba6c223a11c5f9f625cec3232e74221ba46f2025b2e3eb0dc51ea3a83b17ef4d331249182711e40c71c44a64e70aa1c9e41a3ddcbbbb51a84ae5
|
7
|
+
data.tar.gz: efe22e5b460a4a5ccb8ea6d0416a6278496a3277a52339a8692fd451114979da4a6c5ad87cd5b8421ee6316f7bf289eddc49b6b159a9370dffa43a9579f072db
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
## 2.0.2
|
2
|
+
- Fix tests with `Thread.abort_on_exception` turn on
|
1
3
|
## 2.0.0
|
2
4
|
- Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully,
|
3
5
|
instead of using Thread.raise on the plugins' threads. Ref: https://github.com/elastic/logstash/pull/3895
|
@@ -142,7 +142,10 @@ class LogStash::Inputs::Log4j < LogStash::Inputs::Base
|
|
142
142
|
# method used to stop the plugin and unblock
|
143
143
|
# pending blocking operatings like sockets and others.
|
144
144
|
def stop
|
145
|
-
|
145
|
+
begin
|
146
|
+
@server_socket.close if @server_socket && !@server_socket.closed?
|
147
|
+
rescue IOError
|
148
|
+
end
|
146
149
|
end
|
147
150
|
|
148
151
|
public
|
@@ -164,5 +167,6 @@ class LogStash::Inputs::Log4j < LogStash::Inputs::Base
|
|
164
167
|
handle_socket(client_socket, output_queue)
|
165
168
|
end # loop
|
166
169
|
end
|
170
|
+
rescue IOError
|
167
171
|
end # def run
|
168
172
|
end # class LogStash::Inputs::Log4j
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-input-log4j'
|
4
|
-
s.version = '2.0.
|
4
|
+
s.version = '2.0.2'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "Read events over a TCP socket from a Log4j SocketAppender"
|
7
7
|
s.description = "This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program"
|
data/spec/inputs/log4j_spec.rb
CHANGED
@@ -8,22 +8,24 @@ describe LogStash::Inputs::Log4j do
|
|
8
8
|
it "should register" do
|
9
9
|
input = LogStash::Plugin.lookup("input", "log4j").new("mode" => "client")
|
10
10
|
|
11
|
+
|
11
12
|
# register will try to load jars and raise if it cannot find jars or if org.apache.log4j.spi.LoggingEvent class is not present
|
12
13
|
expect {input.register}.to_not raise_error
|
13
14
|
end
|
14
15
|
|
15
|
-
context "when interrupting the plugin" do
|
16
|
-
|
17
|
-
it_behaves_like "an interruptible input plugin"
|
18
|
-
|
19
|
-
end
|
16
|
+
context "when interrupting the plugin in server mode" do
|
17
|
+
let(:config) { { "mode" => "server" } }
|
18
|
+
it_behaves_like "an interruptible input plugin"
|
19
|
+
end
|
20
20
|
|
21
|
+
context "when interrupting the plugin in client mode" do
|
21
22
|
it_behaves_like "an interruptible input plugin" do
|
22
23
|
let(:config) { { "mode" => "client" } }
|
23
24
|
let(:socket) { double("socket") }
|
24
25
|
let(:ois) { double("ois") }
|
25
26
|
before(:each) do
|
26
27
|
allow(socket).to receive(:peer).and_return("localhost")
|
28
|
+
allow(socket).to receive(:close).and_return(true)
|
27
29
|
allow(ois).to receive(:readObject).and_return({})
|
28
30
|
allow(TCPSocket).to receive(:new).and_return(socket)
|
29
31
|
expect(subject).to receive(:socket_to_inputstream).with(socket).and_return(ois)
|