Is it possible to change the logging level of delayed_job separately from the main Rails application?

I would like to use the DEBUG reference level for my Rails application on our intermediate server, but I would like delayed_job (which logs the SELECT in the Rails main log every 10 seconds) to log at the INFO level, so I don't get these delayed_job SELECT .

Is it possible?

+7
ruby-on-rails delayed-job
source share
2 answers

I just ran into this. What I did in my script that runs Delayed :: Job.worker.start had to add before the worker starts:

 RAILS_DEFAULT_LOGGER.level = Logger::INFO 

It worked for me.

0
source share

RAILS_DEFAULT_LOGGER deprecated in Rails versions 3.x, so before calling Delayed::Command.new(ARGV).daemonize you need to use the following in script / delayed_job:

 ::Rails.logger.level = Logger::INFO 
0
source share

All Articles