Instead of whenever needing to log SQL statements, making a custom logging output/function, introduce a centralized subroutine to handle all sql-statement logging. How the SQL-statements should be logged remains to be seen, but currently simply presenting very simple formatting we can discuss about. SQL libraries (DBI, DBIx) also allow logging SQL-statements but lack the fine-grained control Log4perl offers. Or maybe Log4perl can be integrated better to DBI / DBIx with this: https://metacpan.org/pod/DBIx::Log4perl Because I am not a huge fan of DBIx and also integrating that to Koha::Object is a lot of work, will not pursue that track further.
Created attachment 50599 [details] [review] Bug 16329 - Koha::Logger->sql(). Unified interface to log SQL statements Instead of whenever needing to log SQL statements, making a custom logging output/function, introduce a centralized subroutine to handle all sql-statement logging. How the SQL-statements should be logged remains to be seen, but currently simply presenting very simple formatting we can discuss about.
Ok, let's discuss. I would at least suggest prefixing with "SQL:" or similar for parsing/grepping purposes
Marking in Discussion because of Srdjan's last comment. Please note, there is a complex dependency tree here, some of the dependent patches are Failed QA atm.