Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bullet gem not logging from Rails console

I am trying to use the Bullet gem to profile some mySql queries. in config/environments/development.rb, I enable it:

config.after_initialize do
  Bullet.enable = true
  Bullet.bullet_logger = true
  Bullet.rails_logger = true
  Bullet.raise = true
end

I then run a simple import command from the console:

Item.import_file "import/file1.txt"

log/bullet.log is empty. I see all of the mysql queries go by in the console, just no output. Does bullet work in the Rails console? If so, any idea what I'm doing wrong?

Thanks, Kevin

like image 536
user1130176 Avatar asked Oct 31 '25 02:10

user1130176


1 Answers

I think you need to call Bullet.profile:

  Bullet.profile { User.first.as_json } # or something
like image 122
moger777 Avatar answered Nov 02 '25 23:11

moger777