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)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 1 Aug 2022 12:21:38 +0000 (09:21 -0300)
commit18fd0c89cf7f288ad5ff4527484d9e989ed3e5f7
tree7539fac9237ed10a685fe85d0a7f41b32891cdc6
parent4f6164d1940f4d666d2efb0e3e8d76bea3108125
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>
C4/Log.pm
installer/data/mysql/atomicupdate/bug_30984.pl [new file with mode: 0755]
installer/data/mysql/kohastructure.sql