diff --git a/lib/logstash/agent.rb b/lib/logstash/agent.rb index a40921894..fed403549 100644 --- a/lib/logstash/agent.rb +++ b/lib/logstash/agent.rb @@ -96,6 +96,11 @@ class LogStash::Agent < Clamp::Command pipeline.shutdown end + Stud::trap("HUP") do + @logger.info(I18n.t("logstash.agent.sighup")) + configure_logging(log_file) + end + # TODO(sissel): Get pipeline completion status. pipeline.run return 0 @@ -201,7 +206,8 @@ class LogStash::Agent < Clamp::Command end puts "Sending all output to #{path}." - @logger.subscribe(file) + @logger.unsubscribe(@logger_subscription) if @logger_subscription + @logger_subscription = @logger.subscribe(file) else @logger.subscribe(STDOUT) end diff --git a/locales/en.yml b/locales/en.yml index e57b4a283..62cefcbf0 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -50,6 +50,8 @@ en: For more information on plugin statuses, see http://logstash.net/docs/%{LOGSTASH_VERSION}/plugin_status agent: + sighup: >- + SIGHUP received. missing-configuration: >- No configuration file was specified. Perhaps you forgot to provide the '-f yourlogstash.conf' flag?