-
-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to suppress job scheduler logs? #455
Comments
@christianrolle Because GoodJob uses ActiveRecord, these logs would need to be figured out how to be silenced at the Rails level. I'd appreciate it if you were able to dig into how ActiveRecord query logging works. I'm also curious why they're being logged once per second for you. I assume this is happening in the Development environment. The current default development execution mode is async and disabled polling. Is the application overriding the settings for |
@bensheldon |
You can silence logs for any arbitrary block of code like so: def without_ar_logging
logger = ActiveRecord::Base.logger
ActiveRecord::Base.logger = nil
yield
ActiveRecord::Base.logger = logger
end
without_ar_logging { Job.first } # => No log line |
Thanks @JonathanFrias for sharing that. I wanted to check if I am not optimistic that there's a technical solution here. I wanted to back up to:
|
@bensheldon turns out the mentioned polling logs came from a development system and not from a staging/production system as I thought. And that makes sense to me. Haven't seen the source. So I'd like to close this. |
I believe https://github.com/rails/rails/blob/v7.0.0.alpha2/activesupport/lib/active_support/logger_silence.rb |
|
The jobs logging seems to be pretty verbose. I see a lot of logs related to the jobs scheduler, like:
Since this is logged once per second it is a bit noisy and I'd like to suppress those kinda logs.
Any hint is appreciated.
The text was updated successfully, but these errors were encountered: