views:

520

answers:

1

Does anybody know any plugin, that can show line numbers for SQL queries in Rails logs? Something like this:

User Load (0.003154)   SELECT * FROM `users` WHERE (`users`.`id` = 1) - (user.rb, line 24)

Thanks!

+3  A: 

This plugin puts the stack trace in your logs. As Daniel mentions it would be tricky to determine the line you wanted but I suspect you could work something out, and the trace itself may be good enough.

http://terralien.com/projects/querytrace/

Be careful to set it up so you can turn it on and off. I used this for awhile, and while useful for tracking down specific bugs, it drove me nuts if it was on all the time.

Cameron Price