Bug 16329 - Koha::Logger->sql(). Unified interface to log SQL statements OR use DBIx::Log4perl
Summary: Koha::Logger->sql(). Unified interface to log SQL statements OR use DBIx::Log...
Status: In Discussion
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Olli-Antti Kivilahti
QA Contact: Testopia
URL:
Keywords:
Depends on: 16313
Blocks:
  Show dependency treegraph
 
Reported: 2016-04-24 13:20 UTC by Olli-Antti Kivilahti
Modified: 2017-10-15 09:41 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 16329 - Koha::Logger->sql(). Unified interface to log SQL statements (2.08 KB, patch)
2016-04-24 13:22 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Olli-Antti Kivilahti 2016-04-24 13:20:02 UTC
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.
Comment 1 Olli-Antti Kivilahti 2016-04-24 13:22:29 UTC
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.
Comment 2 Srdjan Jankovic 2016-06-01 02:30:17 UTC
Ok, let's discuss. I would at least suggest prefixing with "SQL:" or similar for parsing/grepping purposes
Comment 3 Katrin Fischer 2017-10-15 09:41:43 UTC
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.