From a99c8da0821c9f922269ff5957cad33390b4f7dc Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 5 Dec 2023 13:40:48 +0000 Subject: [PATCH] Bug 35479: (follow-up) Match formatting for other cronjob logs To test: 1 - Install the Kitchen Sink plugin 2 - Restart all 3 - Enable 'CronjobLog' system preference 4 - perl misc/cronjobs/plugins_nightly.pl 5 - Note you see on the command line 'Remember to clean the kitchen' - this indicates the plugin cron ran 6 - Tools->log viewer, select 'cronjob' and view 7 - Note you only see 'plugins_nightly.pl' Run and End lines 8 - Apply patches 9 - perl misc/cronjobs/plugins_nightly.pl 10 - View logs agian 11 - Note you now see Run and End lines for 'Koha::Plugin::Com::ByWaterSolutions::KitchenSink' 12 - Confirm they look like the other lines 13 - Edit KitchenSink.pm and add 'die "Kittens";' to the cronjob nightly 14 - perl misc/cronjobs/plugins_nightly.pl 15 - View logs, confirm there is a FAILED error message for the KitchenSink cron Signed-off-by: Pedro Amorim --- misc/cronjobs/plugins_nightly.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/misc/cronjobs/plugins_nightly.pl b/misc/cronjobs/plugins_nightly.pl index 9816d19bda..64d3529002 100755 --- a/misc/cronjobs/plugins_nightly.pl +++ b/misc/cronjobs/plugins_nightly.pl @@ -24,12 +24,12 @@ if ( C4::Context->config("enable_plugins") ) { foreach my $plugin (@plugins) { my $plugin_name = ref $plugin; try { - cronlogaction({ info => "running nightly cronjob for plugin $plugin_name" }); + cronlogaction({ info => "$plugin_name" }); $plugin->cronjob_nightly(); - cronlogaction({ info => "finished nightly cronjob for plugin $plugin_name" }); + cronlogaction({ action => "End", info => "$plugin_name COMPLETED" }); } catch { - cronlogaction({ info => "failed to running nightly cronjob for plugin $plugin_name with error: $_" }); + cronlogaction({ action => "Error", info => "$plugin_name FAILED with error: $_" }); warn "$_"; $logger->warn("$_"); }; -- 2.30.2