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:
parent
f5824dd586
commit
dfcb8a72fd
|
@ -81,7 +81,7 @@ if Sidekiq.server?
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
Sidekiq.logger.level = Logger::WARN
|
Sidekiq.logger = Sidekiq::Logger.new(STDERR, level: Logger::WARN)
|
||||||
|
|
||||||
class SidekiqLogsterReporter < Sidekiq::ExceptionHandler::Logger
|
class SidekiqLogsterReporter < Sidekiq::ExceptionHandler::Logger
|
||||||
def call(ex, context = {})
|
def call(ex, context = {})
|
||||||
|
|
|
@ -31,7 +31,7 @@ class Demon::Sidekiq < ::Demon::Base
|
||||||
# trouble, if STDOUT is closed in our process all sort of weird
|
# trouble, if STDOUT is closed in our process all sort of weird
|
||||||
# will ensue, resetting the logger ensures it will reinit correctly
|
# will ensue, resetting the logger ensures it will reinit correctly
|
||||||
# parent process is in charge of the file anyway.
|
# 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
|
cli = Sidekiq::CLI.instance
|
||||||
|
|
||||||
# Unicorn uses USR1 to indicate that log files have been rotated
|
# Unicorn uses USR1 to indicate that log files have been rotated
|
||||||
|
|
Loading…
Reference in New Issue