DBIx::Log4perl

DBIx::Log4perl is a Perl extension for DBI to selectively log SQL, parameters, result-sets, transactions etc to a Log::Log4perl handle.

DBIx::Log4perl is available from CPAN.

You can find some tutorials I've written on using DBIx::Log4perl in the
Perl section of the Easysoft web site specifically:

Some references to DBIx::Log4perl: