mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
- Up required version of filewatch
- File glob tailing works.
This commit is contained in:
parent
81d613c1ca
commit
602f406734
1 changed files with 7 additions and 3 deletions
|
@ -1,11 +1,11 @@
|
|||
require "filewatch/buftok" # rubygem 'filewatch' - for BufferedTokenizer
|
||||
require "filewatch/tailglob" # rubygem 'filewatch'
|
||||
require "logstash/namespace"
|
||||
require "logstash/logging"
|
||||
require "logstash/namespace"
|
||||
require "logstash/util"
|
||||
require "set"
|
||||
require "socket" # for Socket.gethostname
|
||||
|
||||
require "eventmachine" # for BufferedTokenizer
|
||||
|
||||
class LogStash::File::Manager
|
||||
attr_accessor :logger
|
||||
|
@ -50,7 +50,11 @@ class LogStash::File::Manager
|
|||
if config.include?("exclude")
|
||||
tailconf[:exclude] = config["exclude"]
|
||||
end
|
||||
@tail.tail(path, tailconf)
|
||||
|
||||
# Register a @tail callback for new paths
|
||||
@tail.tail(path, tailconf) do |fullpath|
|
||||
@watching[path] = config
|
||||
end
|
||||
# TODO(sissel): Make FileWatch emit real exceptions
|
||||
rescue RuntimeError
|
||||
@logger.info("Failed to start watch on #{path.inspect}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue