Bug 42766: Add ScriptLog system preference

Adds a new YesNo system preference 'ScriptLog' in the Logging section
of system preferences, adjacent to CronjobLog. When enabled, the start
and end of non-cron Koha scripts (those using bare 'use Koha::Script'
rather than 'use Koha::Script -cron') will be recorded in the action
log under the SCRIPTS module.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Martin Renvoize 2026-06-03 16:35:06 +01:00 committed by Pedro Amorim
parent fdebc68051
commit 57cceec6bc
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
2 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,19 @@
use Modern::Perl;
use Koha::Installer::Output qw(say_warning say_success say_info);
return {
bug_number => "42766",
description => "Add ScriptLog system preference",
up => sub {
my ($args) = @_;
my ( $dbh, $out ) = @$args{qw(dbh out)};
$dbh->do(
q{
INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` )
VALUES ( 'ScriptLog', '0', '', 'If enabled, log the start and end of non-cron Koha scripts to the action log (module: SCRIPTS).', 'YesNo' )
}
);
say_success( $out, "Added new system preference 'ScriptLog'" );
},
};

View File

@ -90,6 +90,12 @@ Logging:
1: Log
0: "Don't log"
- information from cron jobs.
-
- pref: ScriptLog
choices:
1: Log
0: "Don't log"
- the start and end of non-cron Koha scripts.
-
- pref: ReportsLog
choices: