Is there any way of seeing Bullet logs while the work is processed in Sidekiq worker? When I perform N+1 query in Sidekiq worker (through ActiveJob queue adapter) I don't see the usual Bullet log in neither the Rails console nor the Sidekiq console.
Asked
Active
Viewed 942 times
3
-
Do you have `Bullet.rails_logger = true` in your bullet config? – Raj Mar 27 '17 at 02:04
-
Yes I have it enabled. The problem is that when Sidekiq worker takes over, nothing what the worker does is printed in the rails server log. – Martin Svoboda Mar 27 '17 at 16:00
-
But when i perform the N+1 query in the Rails controller, before I actually call the worker I can see the Bullet log in rails server as usual. – Martin Svoboda Mar 27 '17 at 16:07
-
Any solutions yet? @MartinSvoboda – Zia Ul Rehman Mughal Oct 23 '18 at 10:10
-
I don't recall solving this issue. :( – Martin Svoboda Oct 23 '18 at 14:03
-
https://xkcd.com/979/ – drtechie May 15 '21 at 08:50
1 Answers
0
As they explain in the docs, you can use Bullet.profile
:
class ApplicationJob < ActiveJob::Base
around_perform do |_job, block|
Bullet.profile do
block.call
end
end
end

gonzaloriestra
- 713
- 6
- 15