- make SIGHUP configure logging again (causes the logfile to be

reopened)
This commit is contained in:
Jordan Sissel 2013-06-16 22:43:26 -07:00
parent ffcd656498
commit 5cbc1aa221
2 changed files with 9 additions and 1 deletions

View file

@ -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

View file

@ -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?