Cleanup code around warnings around outputs with no workers allowed

Fixes #4391
This commit is contained in:
Andrew Cholakian 2016-01-07 09:30:48 -06:00
parent e492ff3aba
commit ad48e00340
2 changed files with 5 additions and 3 deletions

View file

@ -74,10 +74,12 @@ module LogStash; class OutputDelegator
# The user has configured extra workers, but this plugin doesn't support it :(
if worker_limits_overriden?
message = @klass.workers_not_supported_message
warning_meta = {:plugin => @klass.config_name, :worker_count => @config["workers"]}
if message
@logger.warn(I18n.t("logstash.pipeline.output-worker-unsupported-with-message", :plugin => @klass.config_name, :worker_count => @config["workers"], :message => message))
warning_meta[:message] = message
@logger.warn(I18n.t("logstash.pipeline.output-worker-unsupported-with-message", warning_meta))
else
@logger.warn(I18n.t("logstash.pipeline.output-worker-unsupported", :plugin => @klass.config_name, :worker_count => @config["workers"], :message => message))
@logger.warn(I18n.t("logstash.pipeline.output-worker-unsupported", warning_meta))
end
end
end

View file

@ -39,7 +39,7 @@ en:
output-worker-unsupported-with-message: >-
%{plugin} output plugin: setting 'workers => %{worker_count}' is not
supported by this plugin. I will continue working as if you had not set
this setting.
this setting. Reason: %{message}
plugin:
deprecated_milestone: >-
%{plugin} plugin is using the 'milestone' method to declare the version