Bug 30984: Action logs should log the cronjob script name that generated the given log
authorKyle Hall <kyle@bywatersolutions.com>
Fri, 17 Jun 2022 10:59:11 +0000 (06:59 -0400)
committerArthur Suzuki <arthur.suzuki@biblibre.com>
Wed, 12 Oct 2022 11:11:20 +0000 (13:11 +0200)
commitdcb767b9bb4935bd2599bca4d2a8f6135504df3e
tree7c33e48217ca7b06ff95c36d77bc92264d216f0a
parent1ed9df7c43a49475a8ef7b6254412634c0406930
Bug 30984: Action logs should log the cronjob script name that generated the given log

When something is changed by a cronjob, and that entity is logged via action logs, we can know what changed, and that it was via a cronjob, but we cannot necessarily know which cronjob made that change. The closest we can come is to find the action logs for the cronjob module which ran before the change which is by no means reliable assuming the CronLog is even enabled.

We should add a new column to action logs to store the name of the script ran for any action logs where the interface is "cron".

Test plan:
1) Apply this patch
2) Run updatedatabase.pl
3) Enable all the Log/Logging sysprefs
4) Run some cronjobs that will generate action logs
5) Note the new action_logs column "script" contains the filename of the
   cronjob that caused the change.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.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 18fd0c89cf7f288ad5ff4527484d9e989ed3e5f7)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 5767add2ccbb4ca4afbe0fbe2d19182c5b44ec9a)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
C4/Log.pm
installer/data/mysql/atomicupdate/bug_30984.pl [new file with mode: 0755]
installer/data/mysql/kohastructure.sql