Wondering if any one has suggestions for changing the log output such that the line of code (and associated file) that resulted in a query is output to the log file when running in the development env. for example: ActionTracker Load (0.016000) [0m [0;1mSELECT * FROM action_trackers WHERE (name=''topicviews'' and entity_id=93 and user_id=88) LIMIT 1 [0m <- action_tracker.rb - line #45 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Philip Hallstrom
2008-Mar-04 22:18 UTC
Re: finding the line of code corresponding to an SQL statement
> Wondering if any one has suggestions for changing the log output such > that the line of code (and associated file) that resulted in a query > is output to the log file when running in the development env.http://agilewebdevelopment.com/plugins/sql_logging> > for example: > > ActionTracker Load (0.016000) [0m [0;1mSELECT * FROM > action_trackers WHERE (name=''topicviews'' and entity_id=93 and > user_id=88) LIMIT 1 [0m > <- action_tracker.rb - line #45 > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
tshim
2008-Mar-04 23:36 UTC
Re: finding the line of code corresponding to an SQL statement
You could try using a custom logger like log4r, or attempt to customize AR itself. On Mar 4, 3:03 pm, jamie <jamie.alexan...-bJEeYj9oJeDQT0dZR+AlfA@public.gmane.org> wrote:> Wondering if any one has suggestions for changing the log output such > that the line of code (and associated file) that resulted in a query > is output to the log file when running in the development env. > > for example: > > ActionTracker Load (0.016000) [0m [0;1mSELECT * FROM > action_trackers WHERE (name=''topicviews'' and entity_id=93 and > user_id=88) LIMIT 1 [0m > <- action_tracker.rb - line #45--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
s.ross
2008-Mar-04 23:59 UTC
Re: finding the line of code corresponding to an SQL statement
On Mar 4, 2008, at 3:36 PM, tshim wrote:> > You could try using a custom logger like log4r, or attempt to > customize AR itself. > > > On Mar 4, 3:03 pm, jamie <jamie.alexan...-bJEeYj9oJeDQT0dZR+AlfA@public.gmane.org> wrote: >> Wondering if any one has suggestions for changing the log output such >> that the line of code (and associated file) that resulted in a query >> is output to the log file when running in the development env. >> >> for example: >> >> ActionTracker Load (0.016000) [0m [0;1mSELECT * FROM >> action_trackers WHERE (name=''topicviews'' and entity_id=93 and >> user_id=88) LIMIT 1 [0m >> <- action_tracker.rb - line #45Check out: http://terralien.com/projects/querytrace/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
jamie
2008-Mar-05 03:47 UTC
Re: finding the line of code corresponding to an SQL statement
fantastic! exactly what I was looking for! On Mar 4, 6:59 pm, "s.ross" <cwdi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Mar 4, 2008, at 3:36 PM, tshim wrote: > > > > > > > You could try using a custom logger like log4r, or attempt to > > customize AR itself. > > > On Mar 4, 3:03 pm, jamie <jamie.alexan...-bJEeYj9oJeDQT0dZR+AlfA@public.gmane.org> wrote: > >> Wondering if any one has suggestions for changing the log output such > >> that the line of code (and associated file) that resulted in a query > >> is output to the log file when running in the development env. > > >> for example: > > >> ActionTracker Load (0.016000) [0m [0;1mSELECT * FROM > >> action_trackers WHERE (name=''topicviews'' and entity_id=93 and > >> user_id=88) LIMIT 1 [0m > >> <- action_tracker.rb - line #45 > > Check out: > > http://terralien.com/projects/querytrace/--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---