You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Generalize silence_polling to silence_queries #210
As mentioned in #198, silence_polling only silences the polling queries (which makes sense), and continues to log for all other querying methods. I think many, especially in a development environment, would be interested in a silence_queries setting to fully silence heart_beat, semaphore, etc queries and keep their logs clean. We likely should maintain silence_polling, at least for now, for backwards compatibility.
Reacted by John McDowall, Brent Lintner, Dmitry Sychev, Ashwin M, natsumi, FiveElementNinja, Kartikey Tanna, Steven Schmid, Felipe Zavan, Louis Kottmann and 5 more
@rosa do you know of a global way we can wrap all the querying methods in solid_queue in a similar fashion to how the polling is wrapped currently? Or is it more likely that we'll just need to pick off the methods one-by-one and make sure new functionality gets wrapped similarly? Happy to take a stab at this one once that approach gets nailed down. Thanks!
Up to this issue, as it really quite distracting in dev mode.
With dozens of jobs / recurring jobs and settings
RAILS_LOG_TO_STDOUT=true
RAILS_LOG_LEVEL=debug
It's literally an infinite flood in the terminal with SolidQueue related SQL logs.
While developer is mostly interested in few messages types "Job Enqueued" / "Performing Job" / "Performed Job" / "Error trace if there is an error".
Also there is ActiveJob with it's own logger in the equation. And while trying to set custom logger to SolidQueue.logger / ActiveJob::Base.logger I still could not synchronize them to show me only "significant logs" like INFO level.
One workaround for this is
bin/jobs
require_relative"../config/environment"require"solid_queue/cli"# Keep using single Rails.logger for everything, but for this instance of Ruby env set log level INFO in dev Rails.logger.level=Logger::INFOifRails.env.local?SolidQueue::Cli.start(ARGV)
It keeps logger setting in one place (basic Rails logger config), log level for web app itself in dev can be still kept debug, but SolidQueue now shows me only more or less important "solid_queue/log_subscriber" events and ActiveJob's "enqueue/performed" logs.
It's a shame there's no TRACE level of logging, because I feel as though these kinds of recurring messages don't make sense to print to the dev log unless they're troubleshooting something specific and opt into it. Would it be possible to add a config.solid_queue.verbose_logs parameter that allows us to limit the verbosity on all reoccurring messages? Also one of my biggest quality impressions is when ctrl+c results in a stack of logs being puked to the console:
Those logs are printed at the INFO level, so this trick doesn't even resolve them when in development. I think they make sense to log in production, but in development when you've rigged solid queue up just for the sake of ActionCable updates flowing to the views correctly, they would never be found helpful, right?
@rosa, do you know the 'logging vision' for solid_queue, especially as it pertains to Rails users leveraging it in development? Months ago, it seemed like this was the best way to observe app behavior as jobs interact with the database and ActionCable broadcast hooks.
Hi @rosa, @namolnad! I put together a PR (#732) that implements the silence_queries approach discussed here and in #198.
It replaces silence_polling with a unified silence_queries config that covers polling, heartbeats, concurrency maintenance, process pruning, and scheduler dynamic task reloading. silence_polling is kept as a backward compatible alias.
Would love your feedback on the direction. Happy to adjust if you had something different in mind!
Reacted by Eugene Kuzminov, Guo Lijun, Guillem and David Bull
Closing the loop here: this ended up solved in Rails rather than in the gem. rails/rails#56899 adds a sql_notifications: false option to the database config, which turns off all SQL notifications for that connection. Setting it on the queue database silences polling, heartbeats, semaphores, pruning, everything, and it's simpler than maintaining a list of things to silence on our side. It'll be in Rails 8.2; silence_polling stays for earlier versions. There's now a note about it next to silence_polling in the README (#795). Thanks all!
Activity
namolnad commentedon Apr 13, 2024
@rosa do you know of a global way we can wrap all the querying methods in solid_queue in a similar fashion to how the polling is wrapped currently? Or is it more likely that we'll just need to pick off the methods one-by-one and make sure new functionality gets wrapped similarly? Happy to take a stab at this one once that approach gets nailed down. Thanks!
iJackUA commentedon Nov 14, 2024
Up to this issue, as it really quite distracting in dev mode.
With dozens of jobs / recurring jobs and settings
It's literally an infinite flood in the terminal with SolidQueue related SQL logs.
While developer is mostly interested in few messages types "Job Enqueued" / "Performing Job" / "Performed Job" / "Error trace if there is an error".
I am also a bit confused trying setting different "logger" for SolidQueue, trying to redirect it's logs and using other log_level. But it is not redirecting all logs, only from here https://github.com/rails/solid_queue/blob/main/lib/solid_queue/log_subscriber.rb
Also there is ActiveJob with it's own logger in the equation. And while trying to set custom logger to
SolidQueue.logger/ActiveJob::Base.loggerI still could not synchronize them to show me only "significant logs" likeINFOlevel.One workaround for this is
bin/jobsIt keeps logger setting in one place (basic Rails logger config), log level for web app itself in dev can be still kept
debug, but SolidQueue now shows me only more or less important "solid_queue/log_subscriber" events and ActiveJob's "enqueue/performed" logs.TheNotary commentedon May 5, 2025
I second the motion to make development logs relevant. These tick:
I followed your solution, iJackUA, but put it into
config/environments/development.rbwhich feels slightly more conventional.(
config/environments/development.rb)It's a shame there's no TRACE level of logging, because I feel as though these kinds of recurring messages don't make sense to print to the dev log unless they're troubleshooting something specific and opt into it. Would it be possible to add a
config.solid_queue.verbose_logsparameter that allows us to limit the verbosity on all reoccurring messages? Also one of my biggest quality impressions is whenctrl+cresults in a stack of logs being puked to the console:Those logs are printed at the INFO level, so this trick doesn't even resolve them when in development. I think they make sense to log in production, but in development when you've rigged solid queue up just for the sake of ActionCable updates flowing to the views correctly, they would never be found helpful, right?
@rosa, do you know the 'logging vision' for solid_queue, especially as it pertains to Rails users leveraging it in development? Months ago, it seemed like this was the best way to observe app behavior as jobs interact with the database and ActionCable broadcast hooks.
Generalize silence_polling to silence_queries
Generalize silence_polling to silence_queries
diogovernier commentedon Apr 9, 2026
Hi @rosa, @namolnad! I put together a PR (#732) that implements the
silence_queriesapproach discussed here and in #198.It replaces
silence_pollingwith a unifiedsilence_queriesconfig that covers polling, heartbeats, concurrency maintenance, process pruning, and scheduler dynamic task reloading.silence_pollingis kept as a backward compatible alias.Would love your feedback on the direction. Happy to adjust if you had something different in mind!
Point to sql_notifications for silencing all queue database queries
rosa commentedon Aug 29, 2026
Closing the loop here: this ended up solved in Rails rather than in the gem. rails/rails#56899 adds a
sql_notifications: falseoption to the database config, which turns off all SQL notifications for that connection. Setting it on thequeuedatabase silences polling, heartbeats, semaphores, pruning, everything, and it's simpler than maintaining a list of things to silence on our side. It'll be in Rails 8.2;silence_pollingstays for earlier versions. There's now a note about it next tosilence_pollingin the README (#795). Thanks all!