lib/fluent/plugin/buf_file.rb in fluentd-0.10.36 vs lib/fluent/plugin/buf_file.rb in fluentd-0.10.37
- old
+ new
@@ -73,18 +73,26 @@
end
class FileBuffer < BasicBuffer
Plugin.register_buffer('file', self)
+ @@buffer_paths = {}
+
def initialize
require 'uri'
super
end
config_param :buffer_path, :string
def configure(conf)
super
+
+ if @@buffer_paths.has_key?(@buffer_path)
+ raise ConfigError, "Other '#{@@buffer_paths[@buffer_path]}' plugin already use same buffer_path: type = #{conf['type']}, buffer_path = #{@buffer_path}"
+ else
+ @@buffer_paths[@buffer_path] = conf['type']
+ end
if pos = @buffer_path.index('*')
@buffer_path_prefix = @buffer_path[0,pos]
@buffer_path_suffix = @buffer_path[pos+1..-1]
else