]> 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)
committerJacob O'Mara <jacob.omara@ptfs-europe.com>
Mon, 6 Feb 2023 15:54:06 +0000 (15:54 +0000)
commit872d03963e09633c50dabf3ac3be92bdb9cab391
treed2a5812c5cab038734e90250417ee967b302de92
parentdfc1e7d2daf0e100f487177c953891db28f41eb5
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>
(cherry picked from commit 3b1f2c57eaed978845eef3824c7311da06099bc5)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
debian/koha-common.postinst
etc/log4perl.conf
misc/background_jobs_worker.pl