]> git.koha-community.org Git - koha.git/commit
Bug 32612: Add worker-error to log4perl conf
authorNick Clemens <nick@bywatersolutions.com>
Wed, 11 Jan 2023 18:46:11 +0000 (18:46 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 3 Feb 2023 13:30:02 +0000 (10:30 -0300)
commit3b1f2c57eaed978845eef3824c7311da06099bc5
tree434bd7a9739e44d5f35fae6fc9afffa93fd01c1c
parent1b6e9c7bd1c6e50ab610c6d15fe2e46af2f666ec
Bug 32612: Add worker-error to log4perl conf

To test:
1 - Apply patch
2 - vim /etc/koha/sites/kohadev/log4perl.conf, Add lines below:
log4perl.logger.worker = WARN, WORKER
log4perl.appender.WORKER=Log::Log4perl::Appender::Screen
log4perl.appender.WORKER.stderr=1
log4perl.appender.WORKER.mode=append
log4perl.appender.WORKER.layout=PatternLayout
log4perl.appender.WORKER.layout.ConversionPattern=[%d] [%p] %m %l%n
log4perl.appender.WORKER.utf8=1
3 - Restart all
4 - Edit misc/background_jobs_worker.pl
-        my $job = Koha::BackgroundJobs->find($args->{job_id});
+        my $job;# = Koha::BackgroundJobs->find($args->{job_id});
5 - In another terminal: tail -f /var/log/koha/kohadev/koha-worker-error.log
6 - Force enqueue a job (that won't be found because of #4
  perl -e 'use Koha::BackgroundJob::BatchUpdateItem; my $bg = Koha::BackgroundJob::BatchUpdateItem->new(); $bg->enqueue({ record_ids=>['888888']});'
7 - Note error in log like:
  [2023/01/11 19:26:10] [WARN] No job found for id=2983 main:: /kohadevbox/koha/misc/background_jobs_worker.pl (111)

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
debian/koha-common.postinst
etc/log4perl.conf
misc/background_jobs_worker.pl