# How do i see SQL in my logs?

**URL:** <https://www.ruby-forum.com/t/how-do-i-see-sql-in-my-logs/91201>\
**Category:** Rails\
**Created:** [April 5, 2007, 4:36pm UTC](https://www.ruby-forum.com/t/how-do-i-see-sql-in-my-logs/91201 "2007-04-05T16:36:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gedanken](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b487fb/32.png) [@Gedanken](https://www.ruby-forum.com/u/Gedanken)\
**Post date:** [April 5, 2007, 4:36pm UTC](https://www.ruby-forum.com/t/how-do-i-see-sql-in-my-logs/91201/1 "2007-04-05T16:36:56Z")

</div>

Warning, long time coder but new to RoR

I am not seeing anywhere near the level of logging i want in my logs,  
for the sql stuff. regular ruby logging ( in development.log) seems  
ok.

For example,

Mysql::Error (Access denied for user ‘rw’@‘localhost’ (using password:  
NO)):

What query generated this error? what table was it trying to access?!?

---

<div class="post-metadata">

**Author:** ![Gedanken](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/b487fb/32.png) [@Gedanken](https://www.ruby-forum.com/u/Gedanken)\
**Post date:** [April 5, 2007, 8:57pm UTC](https://www.ruby-forum.com/t/how-do-i-see-sql-in-my-logs/91201/2 "2007-04-05T20:57:28Z")

</div>

The query\_analyzer plugin is great for EXPLAINing the database queries  
that are going on in your app.

[http://agilewebdevelopment.com/plugins/query\_analyzer](http://agilewebdevelopment.com/plugins/query_analyzer)

If you’re getting an error like you mentioned, though, your app  
probably isn’t even trying to make any queries. It sounds like it  
can’t even connect to the database.
