Koha Tutorial Videos
Monday Minutes: Action Logs Update
In this week's Monday Minutes, Andrew and Jessie talk about a new feature in the actions logs which helps staff identify what exactly is different in changes made to the database. First, Welcome back, Andrew!! We are excited to welcome them back to ByWater Solutions!!
Bug 25159 - Action logs should be stored in JSON (and as a diff of the change). This enhancement begins the process of standardizing action logs across modules. This will allow staff to troubleshoot and view both before and after values.
System Preferences
Actions within the Koha system are tracked in log files. Your system preferences can be changed to prevent the logging of different actions. These logs can be viewed using the log viewer.
Options can be set to Log or Don't Log.
Tools
- Navigate to More > Tools > Additional tools > Log viewer
- Only staff with the view_system_logs permission (or the superlibrarian permission) will have access to this tool.
- Only staff with the view_system_logs permission (or the superlibrarian permission) will have access to this tool.
- If staff see a warning sign next to a module name, this indicates that the actions in this module are not being logged. Staff can change the logs preferences to log actions from a module in the system preference (listed above).
- From here staff can select different combinations of menu options that will produce the log file for that query.
Reports on Wiki
Andrew mentions the actions log table in the Wiki.
In the action_logs table, timestamp always indicates when the log entry was written, and user is either the borrowernumber of the staff member taking the action or 0 if the action was initiated by Koha itself (e.g. in the case of fines added or updated by fines.pl).
The values of action, object, and info vary by module, along with the system preference that enables or disables those logs.
Report Example
SELECT a.diff,
json_extract(a.diff,'$.D'),
json_extract(a.diff,'$.D.branchcode'),
json_extract(a.diff,'$.D.branchcode.O'),
json_extract(a.diff,'$.D.branchcode.N')
FROM action_logs a WHERE DATE(timestamp) = CURDATE() AND module='HOLDS' AND diff LIKE '%branchcode%'
Additional Resources
Using the Log Viewer Tool in Koha
Read more by Jessie Zairo