Forum: Ruby on Rails Extracting SQL statements from the rails development log

A59831714e42926c56922a24234700df?d=identicon&s=25 Gurdipe Dosanjh (Guest)
on 2012-06-19 21:47
(Received via mailing list)
Hi

I need to extract all the sql statements from the the rails development
log.

Is there a quick way to do this using a regular expression or another
method?

Kind Regards

Gurdipe
280b78a61a968391b7e07e912be102a8?d=identicon&s=25 Robert Walker (robert4723)
on 2012-06-20 00:54
Gurdipe Dosanjh wrote in post #1065210:
> I need to extract all the sql statements from the the rails development
> log.
>
> Is there a quick way to do this using a regular expression or another
> method?

This makes it sound unlikely:

http://stackoverflow.com/questions/139926/regular-...

BTW, is your Google broken? This is was the second link in my Google.
6883e5ef03484d4fcef507d7b4f1d243?d=identicon&s=25 Matt Jones (Guest)
on 2012-06-20 13:56
(Received via mailing list)
On Tuesday, 19 June 2012 15:46:12 UTC-4, Gurdipe Dosanjh wrote:
>
> Hi
>
> I need to extract all the sql statements from the the rails development
> log.
>
> Is there a quick way to do this using a regular expression or another
> method?
>
>
If you're looking to grab all the queries, check out the Notification
system:

http://asciicasts.com/episodes/249-notifications-in-rails-3

the 'sql.active_record' notification will be fired every time there's a
query.

--Matt Jones
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.