[Koha-bugs] [Bug 35907] Add ability to log all custom report runs with or without query

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Jan 25 19:38:18 CET 2024


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35907

Kyle M Hall <kyle at bywatersolutions.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #161452|0                           |1
        is obsolete|                            |
 Attachment #161453|0                           |1
        is obsolete|                            |

--- Comment #5 from Kyle M Hall <kyle at bywatersolutions.com> ---
Created attachment 161458
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=161458&action=edit
Bug 35907: Add ability to log all custom report runs with or without query

Because of the way Koha::Logger has been used to log to different categories
based on the interface and caller, it can be extremely hard to log all of a
particular log statement to one place.

For custom report runs, the category is plack-intranet.C4::Reports::Guided when
run from the web interface, cron.C4::Reports::Guided when run from
runreport.pl, and plack-intranet.C4::Auth when run from svc/report.

We should add a more standardized report run log, both with and without the
full query, so that administrators can log all report runs to a centralized
location. If an administrator were to need the "point of entry" for reports, it
is easy to include via parameters in PatternLayout.

Test Plan:
1) Apply this patch
2) Modify your log4perl file, add the following:

log4perl.logger.reports.execute.time = INFO, REPORTTIME
log4perl.appender.REPORTTIME=Log::Log4perl::Appender::File
log4perl.appender.REPORTTIME.filename=/tmp/report-time.log
log4perl.appender.REPORTTIME.mode=append
log4perl.appender.REPORTTIME.layout=PatternLayout
log4perl.appender.REPORTTIME.layout.ConversionPattern=[%d] [%p] [%P] %m%n
log4perl.appender.REPORTTIME.utf8=1

log4perl.logger.reports.execute.query = INFO, REPORTQUERY
log4perl.appender.REPORTQUERY=Log::Log4perl::Appender::File
log4perl.appender.REPORTQUERY.filename=/tmp/report-query.log
log4perl.appender.REPORTQUERY.mode=append
log4perl.appender.REPORTQUERY.layout=PatternLayout
log4perl.appender.REPORTQUERY.layout.ConversionPattern=[%d] [%p] [%P] %m%n
log4perl.appender.REPORTQUERY.utf8=1

3) Restart all the things!
4) Run a report somehow:
   CLI: ./misc/cronjobs/runreport.pl 1
   API: /cgi-bin/koha/svc/report?id=1
   Web: /cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Run this report
5) Note the report runs are logged to /tmp/report-time.log and
/tmp/report-query.log

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list