Logging Database Queries in Magento

In lib/Varien/Db/Adapter/Pdo/Mysql.php

around line 103 (for EE 1.13) you find some flags you can set to log DB queries to a file:

protected $_debug = false;

/**
* Minimum query duration time to be logged
*
* @var float
*/
protected $_logQueryTime = 0.05;

/**
* Log all queries (ignored minimum query duration time)
*
* @var bool
*/
protected $_logAllQueries = false;

/**
* Add to log call stack data (backtrace)
*
* @var bool
*/
protected $_logCallStack = false;

/**
* Path to SQL debug data log
*
* @var string
*/
protected $_debugFile = ‘var/debug/pdo_mysql.log’;

Set $_debug, $_logAllQueries to true.
Give $_debufFile a valid logfile name.
Be sure to set $_debug to false when done trapping queries – this log can fill up FAST!