Skip to content

Commit

Permalink
Merge pull request #1206 from fluent/fix-bug-not-to-load-multi_output…
Browse files Browse the repository at this point in the history
…-in-agent

fix bug to depend on class name of Fluent::Plugin::MultiOutput
  • Loading branch information
tagomoris authored Sep 6, 2016
2 parents 7061c1c + f3e599d commit 191108c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/fluent/agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ def add_match(type, pattern, conf)
output.router = @event_router if output.respond_to?(:router=)
output.configure(conf)
@outputs << output
if output.respond_to?(:outputs) && (output.is_a?(Fluent::Plugin::MultiOutput) || output.is_a?(Fluent::MultiOutput))
if output.respond_to?(:outputs) && (output.respond_to?(:multi_output?) && output.multi_output? || output.is_a?(Fluent::MultiOutput))
# TODO: ruby 2.3 or later: replace `output.respond_to?(:multi_output?) && output.multi_output?` with output&.multi_output?
@outputs.push(*output.outputs)
end
@event_router.add_rule(pattern, output)
Expand Down
4 changes: 4 additions & 0 deletions lib/fluent/plugin/multi_output.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ def initialize
# @rollback_count = 0
end

def multi_output?
true
end

def configure(conf)
super

Expand Down

0 comments on commit 191108c

Please sign in to comment.