データベース トレースログ
PostgreSQL
下記コードで挟み込む
pg_trace(DATA_REALDIR . 'logs/db-trace.log'); // DB処理 pg_untrace();