diff --git a/lib/sidekiq/cli.rb b/lib/sidekiq/cli.rb index 989ece57..6289256f 100644 --- a/lib/sidekiq/cli.rb +++ b/lib/sidekiq/cli.rb @@ -16,8 +16,10 @@ trap 'USR1' do end trap 'USR2' do - Sidekiq.logger.info "Received USR2, reopening log file" - Sidekiq.logger = Sidekiq::Logging.new_file_logger(Sidekiq.options[:logfile]) + if Sidekiq.options[:logfile] + Sidekiq.logger.info "Received USR2, reopening log file" + Sidekiq.logger = Sidekiq::Logging.new_file_logger(Sidekiq.options[:logfile]) + end end trap 'TTIN' do