logstash-core 5.0.0.alpha6.snapshot1-java → 5.0.0.alpha6.snapshot2-java

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of logstash-core might be problematic. Click here for more details.

Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/lib/jars.rb +7 -0
  3. data/lib/logstash-core/version.rb +1 -1
  4. data/lib/logstash/agent.rb +2 -2
  5. data/lib/logstash/api/rack_app.rb +14 -15
  6. data/lib/logstash/config/config_ast.rb +2 -2
  7. data/lib/logstash/config/file.rb +1 -2
  8. data/lib/logstash/config/mixin.rb +9 -11
  9. data/lib/logstash/environment.rb +2 -1
  10. data/lib/logstash/filters/base.rb +1 -0
  11. data/lib/logstash/inputs/base.rb +1 -0
  12. data/lib/logstash/java_integration.rb +1 -0
  13. data/lib/logstash/logging.rb +1 -89
  14. data/lib/logstash/logging/json.rb +1 -1
  15. data/lib/logstash/logging/logger.rb +72 -0
  16. data/lib/logstash/output_delegator.rb +8 -16
  17. data/lib/logstash/output_delegator_strategies/legacy.rb +2 -1
  18. data/lib/logstash/output_delegator_strategies/shared.rb +1 -0
  19. data/lib/logstash/output_delegator_strategies/single.rb +1 -0
  20. data/lib/logstash/outputs/base.rb +5 -0
  21. data/lib/logstash/patches/clamp.rb +21 -0
  22. data/lib/logstash/pipeline.rb +24 -24
  23. data/lib/logstash/pipeline_reporter.rb +1 -1
  24. data/lib/logstash/plugin.rb +3 -10
  25. data/lib/logstash/plugins/registry.rb +3 -1
  26. data/lib/logstash/runner.rb +47 -74
  27. data/lib/logstash/shutdown_watcher.rb +1 -8
  28. data/lib/logstash/util/decorators.rb +3 -4
  29. data/lib/logstash/util/java_version.rb +0 -5
  30. data/lib/logstash/util/loggable.rb +7 -17
  31. data/lib/logstash/util/safe_uri.rb +2 -0
  32. data/lib/logstash/util/wrapped_synchronous_queue.rb +5 -5
  33. data/lib/logstash/version.rb +1 -1
  34. data/locales/en.yml +19 -8
  35. data/logstash-core.gemspec +4 -3
  36. data/spec/api/lib/rack_app_spec.rb +6 -4
  37. data/spec/logstash/config/loader_spec.rb +3 -1
  38. data/spec/logstash/config/mixin_spec.rb +28 -9
  39. data/spec/logstash/output_delegator_spec.rb +15 -2
  40. data/spec/logstash/outputs/base_spec.rb +0 -1
  41. data/spec/logstash/pipeline_reporter_spec.rb +1 -0
  42. data/spec/logstash/pipeline_spec.rb +14 -2
  43. data/spec/logstash/plugin_spec.rb +7 -6
  44. data/spec/logstash/runner_spec.rb +62 -44
  45. data/spec/logstash/shutdown_watcher_spec.rb +0 -4
  46. metadata +21 -18
@@ -15,13 +15,20 @@ end
15
15
  describe LogStash::Runner do
16
16
 
17
17
  subject { LogStash::Runner }
18
- let(:channel) { Cabin::Channel.new }
18
+ let(:logger) { double("logger") }
19
19
 
20
20
  before :each do
21
- allow(Cabin::Channel).to receive(:get).with(LogStash).and_return(channel)
22
- allow(channel).to receive(:subscribe).with(any_args)
23
- allow(channel).to receive(:log) {}
24
- allow(LogStash::ShutdownWatcher).to receive(:logger).and_return(channel)
21
+ allow(LogStash::Runner).to receive(:logger).and_return(logger)
22
+ allow(logger).to receive(:debug?).and_return(true)
23
+ allow(logger).to receive(:subscribe).with(any_args)
24
+ allow(logger).to receive(:log) {}
25
+ allow(logger).to receive(:info) {}
26
+ allow(logger).to receive(:fatal) {}
27
+ allow(logger).to receive(:warn) {}
28
+ allow(LogStash::ShutdownWatcher).to receive(:logger).and_return(logger)
29
+ allow(LogStash::Logging::Logger).to receive(:configure_logging) do |level, path|
30
+ allow(logger).to receive(:level).and_return(level.to_sym)
31
+ end
25
32
  end
26
33
 
27
34
  after :each do
@@ -29,7 +36,6 @@ describe LogStash::Runner do
29
36
  end
30
37
 
31
38
  after :all do
32
- LogStash::ShutdownWatcher.logger = nil
33
39
  end
34
40
 
35
41
  describe "argument precedence" do
@@ -56,16 +62,13 @@ describe LogStash::Runner do
56
62
 
57
63
  describe "argument parsing" do
58
64
  subject { LogStash::Runner.new("") }
59
- before :each do
60
- allow(Cabin::Channel.get(LogStash)).to receive(:terminal)
61
- end
65
+
62
66
  context "when -e is given" do
63
67
 
64
68
  let(:args) { ["-e", "input {} output {}"] }
65
69
  let(:agent) { double("agent") }
66
70
 
67
71
  before do
68
- allow(agent).to receive(:logger=).with(anything)
69
72
  allow(agent).to receive(:shutdown)
70
73
  allow(agent).to receive(:register_pipeline)
71
74
  end
@@ -131,32 +134,6 @@ describe LogStash::Runner do
131
134
  end
132
135
  end
133
136
 
134
- describe "--log.format=json" do
135
- subject { LogStash::Runner.new("") }
136
- let(:logfile) { Stud::Temporary.file }
137
- let(:args) { [ "--log.format", "json", "-l", logfile.path, "-e", "input {} output{}" ] }
138
-
139
- after do
140
- logfile.close
141
- File.unlink(logfile.path)
142
- end
143
-
144
- before do
145
- expect(channel).to receive(:subscribe).with(kind_of(LogStash::Logging::JSON)).and_call_original
146
- subject.run(args)
147
-
148
- # Log file should have stuff in it.
149
- expect(logfile.stat.size).to be > 0
150
- end
151
-
152
- it "should log in valid json. One object per line." do
153
- logfile.each_line do |line|
154
- expect(line).not_to be_empty
155
- expect { JSON.parse(line) }.not_to raise_error
156
- end
157
- end
158
- end
159
-
160
137
  describe "--config.test_and_exit" do
161
138
  subject { LogStash::Runner.new("") }
162
139
  let(:args) { ["-t", "-e", pipeline_string] }
@@ -164,7 +141,6 @@ describe LogStash::Runner do
164
141
  context "with a good configuration" do
165
142
  let(:pipeline_string) { "input { } filter { } output { }" }
166
143
  it "should exit successfuly" do
167
- expect(channel).to receive(:terminal)
168
144
  expect(subject.run(args)).to eq(0)
169
145
  end
170
146
  end
@@ -172,7 +148,7 @@ describe LogStash::Runner do
172
148
  context "with a bad configuration" do
173
149
  let(:pipeline_string) { "rlwekjhrewlqrkjh" }
174
150
  it "should fail by returning a bad exit code" do
175
- expect(channel).to receive(:fatal)
151
+ expect(logger).to receive(:fatal)
176
152
  expect(subject.run(args)).to eq(1)
177
153
  end
178
154
  end
@@ -303,28 +279,70 @@ describe LogStash::Runner do
303
279
  it "should set log level to warn" do
304
280
  args = ["--version"]
305
281
  subject.run("bin/logstash", args)
306
- expect(channel.level).to eq(:warn)
282
+ expect(logger.level).to eq(:warn)
307
283
  end
308
284
  end
309
285
  context "when setting to debug" do
310
286
  it "should set log level to debug" do
311
287
  args = ["--log.level", "debug", "--version"]
312
288
  subject.run("bin/logstash", args)
313
- expect(channel.level).to eq(:debug)
289
+ expect(logger.level).to eq(:debug)
314
290
  end
315
291
  end
316
292
  context "when setting to verbose" do
317
293
  it "should set log level to info" do
318
- args = ["--log.level", "verbose", "--version"]
294
+ args = ["--log.level", "info", "--version"]
319
295
  subject.run("bin/logstash", args)
320
- expect(channel.level).to eq(:info)
296
+ expect(logger.level).to eq(:info)
321
297
  end
322
298
  end
323
299
  context "when setting to quiet" do
324
300
  it "should set log level to error" do
325
- args = ["--log.level", "quiet", "--version"]
301
+ args = ["--log.level", "error", "--version"]
326
302
  subject.run("bin/logstash", args)
327
- expect(channel.level).to eq(:error)
303
+ expect(logger.level).to eq(:error)
304
+ end
305
+ end
306
+
307
+ context "deprecated flags" do
308
+ context "when using --quiet" do
309
+ it "should warn about the deprecated flag" do
310
+ expect(logger).to receive(:warn).with(/DEPRECATION WARNING/)
311
+ args = ["--quiet", "--version"]
312
+ subject.run("bin/logstash", args)
313
+ end
314
+
315
+ it "should still set the log level accordingly" do
316
+ args = ["--quiet", "--version"]
317
+ subject.run("bin/logstash", args)
318
+ expect(logger.level).to eq(:error)
319
+ end
320
+ end
321
+ context "when using --debug" do
322
+ it "should warn about the deprecated flag" do
323
+ expect(logger).to receive(:warn).with(/DEPRECATION WARNING/)
324
+ args = ["--debug", "--version"]
325
+ subject.run("bin/logstash", args)
326
+ end
327
+
328
+ it "should still set the log level accordingly" do
329
+ args = ["--debug", "--version"]
330
+ subject.run("bin/logstash", args)
331
+ expect(logger.level).to eq(:debug)
332
+ end
333
+ end
334
+ context "when using --verbose" do
335
+ it "should warn about the deprecated flag" do
336
+ expect(logger).to receive(:warn).with(/DEPRECATION WARNING/)
337
+ args = ["--verbose", "--version"]
338
+ subject.run("bin/logstash", args)
339
+ end
340
+
341
+ it "should still set the log level accordingly" do
342
+ args = ["--verbose", "--version"]
343
+ subject.run("bin/logstash", args)
344
+ expect(logger.level).to eq(:info)
345
+ end
328
346
  end
329
347
  end
330
348
  end
@@ -3,8 +3,6 @@ require "spec_helper"
3
3
  require "logstash/shutdown_watcher"
4
4
 
5
5
  describe LogStash::ShutdownWatcher do
6
- let(:channel) { Cabin::Channel.new }
7
-
8
6
  let(:check_every) { 0.01 }
9
7
  let(:check_threshold) { 100 }
10
8
  subject { LogStash::ShutdownWatcher.new(pipeline, check_every) }
@@ -14,8 +12,6 @@ describe LogStash::ShutdownWatcher do
14
12
  report_count = 0
15
13
 
16
14
  before :each do
17
- LogStash::ShutdownWatcher.logger = channel
18
-
19
15
  allow(pipeline).to receive(:reporter).and_return(reporter)
20
16
  allow(pipeline).to receive(:thread).and_return(Thread.current)
21
17
  allow(reporter).to receive(:snapshot).and_return(reporter_snapshot)
metadata CHANGED
@@ -1,21 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0.alpha6.snapshot1
4
+ version: 5.0.0.alpha6.snapshot2
5
5
  platform: java
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-22 00:00:00.000000000 Z
11
+ date: 2016-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 5.0.0.alpha6.snapshot1
18
+ version: 5.0.0.alpha6.snapshot2
19
19
  name: logstash-core-event-java
20
20
  prerelease: false
21
21
  type: :runtime
@@ -23,21 +23,7 @@ dependencies:
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 5.0.0.alpha6.snapshot1
27
- - !ruby/object:Gem::Dependency
28
- requirement: !ruby/object:Gem::Requirement
29
- requirements:
30
- - - "~>"
31
- - !ruby/object:Gem::Version
32
- version: 0.8.0
33
- name: cabin
34
- prerelease: false
35
- type: :runtime
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: 0.8.0
26
+ version: 5.0.0.alpha6.snapshot2
41
27
  - !ruby/object:Gem::Dependency
42
28
  requirement: !ruby/object:Gem::Requirement
43
29
  requirements:
@@ -282,6 +268,20 @@ dependencies:
282
268
  - - "~>"
283
269
  - !ruby/object:Gem::Version
284
270
  version: 0.4.0
271
+ - !ruby/object:Gem::Dependency
272
+ requirement: !ruby/object:Gem::Requirement
273
+ requirements:
274
+ - - "~>"
275
+ - !ruby/object:Gem::Version
276
+ version: 0.3.4
277
+ name: jar-dependencies
278
+ prerelease: false
279
+ type: :runtime
280
+ version_requirements: !ruby/object:Gem::Requirement
281
+ requirements:
282
+ - - "~>"
283
+ - !ruby/object:Gem::Version
284
+ version: 0.3.4
285
285
  description: The core components of logstash, the scalable log and event management tool
286
286
  email:
287
287
  - info@elastic.co
@@ -289,6 +289,7 @@ executables: []
289
289
  extensions: []
290
290
  extra_rdoc_files: []
291
291
  files:
292
+ - lib/jars.rb
292
293
  - lib/logstash-core.rb
293
294
  - lib/logstash-core/logstash-core.rb
294
295
  - lib/logstash-core/version.rb
@@ -347,6 +348,7 @@ files:
347
348
  - lib/logstash/json.rb
348
349
  - lib/logstash/logging.rb
349
350
  - lib/logstash/logging/json.rb
351
+ - lib/logstash/logging/logger.rb
350
352
  - lib/logstash/namespace.rb
351
353
  - lib/logstash/output_delegator.rb
352
354
  - lib/logstash/output_delegator_strategies/legacy.rb
@@ -459,6 +461,7 @@ post_install_message:
459
461
  rdoc_options: []
460
462
  require_paths:
461
463
  - lib
464
+ - vendor/jars
462
465
  required_ruby_version: !ruby/object:Gem::Requirement
463
466
  requirements:
464
467
  - - ">="