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)
committerLucas Gass <lucas@bywatersolutions.com>
Thu, 29 Sep 2022 15:25:33 +0000 (15:25 +0000)
commit5767add2ccbb4ca4afbe0fbe2d19182c5b44ec9a
tree4bedd95f0e75f4f37af6ecce651e5c0aa1c69829
parentecc6a21ad23c9bf417cc13f972264ac83685410e
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>
C4/Log.pm
installer/data/mysql/atomicupdate/bug_30984.pl [new file with mode: 0755]
installer/data/mysql/kohastructure.sql