Debugging ORM queries with database logs

Log database queries directly instead of relying on ORM logging options.