The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

Changes for version 0.11

  • DBIx::Log4perl did not support the use of statement handles returned as output bound parameters in DBD::Oracle because it had not seen them created and hence had not injected the log handle into them.
  • DBIx::Log4perl was changed to only retrieve Oracle dbms_output if the logging handle has debug enabled but unfortunately it was continuing to enable dbms_output regardless of logging mode. As a result, once dbms_output was enabled, the Oracle dbms_output buffer starts filling and once full your procedures die.
  • DBIx::Log4perl no longer sets $Log::Log4perl::caller_depth to 2 in the BEGIN because the depth depends on the method you are in. Instead Log::Log4perl::caller_depth is set in each method.
  • Database methods and statement methods are now logged with one or more numbers (in brackets) indicating which connection or statement handle is being used. e.g.,
  • DEBUG - connect(0): DBI:CSV: DEBUG - connect(1): DBI:CSV: DEBUG - connect(2): DBI:CSV: DEBUG - do(0): 'drop table fred' DEBUG - prepare(0.3): 'insert into fred (id, name) values(?,?)' DEBUG - $execute_array(0.3) = [undef,1,'one']; DEBUG - $bind_param_array(0.3) = [1,1]; DEBUG - $bind_param_array(0.3) = [2,'one']; DEBUG - finish(0.3)
  • which shows 3 connections numbered 0, 1 and 2 and the prepare etc methods are all called in connection 0 using statement 3 i.e., where there is one number it is a connection and where there are two e.g., (0.3), the first is the connection and the second the statement.
  • A modest speed up when using DBIx::Log4perl and some categories of logging are disabled.
  • Connect method could use uninitialised dsn/user if they are not set in the connect call e.g. DBI:CSV:

Modules

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

Provides

in lib/DBIx/Log4perl/Constants.pm
in lib/DBIx/Log4perl/db.pm
in lib/DBIx/Log4perl/st.pm

Examples