DEV: Ensure Sidekiq warnings are logged to STDERR (#15800)

The default configuration will log to STOUT, which pollutes the output of scripts/rake-tasks
This commit is contained in:
David Taylor 2022-02-03 14:24:15 +00:00 committed by GitHub
parent f5824dd586
commit dfcb8a72fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -81,7 +81,7 @@ if Sidekiq.server?
end
end
Sidekiq.logger.level = Logger::WARN
Sidekiq.logger = Sidekiq::Logger.new(STDERR, level: Logger::WARN)
class SidekiqLogsterReporter < Sidekiq::ExceptionHandler::Logger
def call(ex, context = {})

View File

@ -31,7 +31,7 @@ class Demon::Sidekiq < ::Demon::Base
# trouble, if STDOUT is closed in our process all sort of weird
# will ensue, resetting the logger ensures it will reinit correctly
# parent process is in charge of the file anyway.
Sidekiq.logger = nil
Sidekiq.logger = Sidekiq::Logger.new(STDERR, level: Logger::WARN)
cli = Sidekiq::CLI.instance
# Unicorn uses USR1 to indicate that log files have been rotated