mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
always set logger and call .register
This commit is contained in:
parent
003a680d78
commit
42394069a9
2 changed files with 12 additions and 4 deletions
|
@ -80,8 +80,11 @@ class LogStash::Agent
|
|||
# Start inputs
|
||||
@inputs.each do |input|
|
||||
@logger.info(["Starting input", input])
|
||||
input.logger = @logger
|
||||
@threads[input] = Thread.new { input.run(queue) }
|
||||
@threads[input] = Thread.new do
|
||||
input.logger = @logger
|
||||
input.register
|
||||
input.run(queue)
|
||||
end
|
||||
end
|
||||
|
||||
# Create N filter-worker threads
|
||||
|
@ -121,8 +124,8 @@ class LogStash::Agent
|
|||
|
||||
@threads["outputs/#{output}"] = Thread.new do
|
||||
JThread.currentThread().setName("output/#{output}")
|
||||
output.register
|
||||
output.logger = @logger
|
||||
output.register
|
||||
|
||||
while event = queue.pop do
|
||||
output.receive(event)
|
||||
|
|
|
@ -12,6 +12,11 @@ class LogStash::Inputs::File < LogStash::Inputs::Base
|
|||
config_name "file"
|
||||
config :path => nil # no validation on path, it can be anything.
|
||||
|
||||
public
|
||||
def register
|
||||
# nothing
|
||||
end # def register
|
||||
|
||||
public
|
||||
def run(queue)
|
||||
@@filemanager_lock.synchronize do
|
||||
|
@ -24,5 +29,5 @@ class LogStash::Inputs::File < LogStash::Inputs::Base
|
|||
end
|
||||
|
||||
@@filemanager.watch(@path, @config)
|
||||
end
|
||||
end # def run
|
||||
end # class LogStash::Inputs::File
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue