Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Audit messages

Vitali Peil edited this page Jun 25, 2019 · 12 revisions

Audit messages keep track of important user actions on publications stored in LibreCat. The audit mechanism can be activated in LibreCat by adding audit_message Hook to the hooks.yml configuration files. This hook should be added to the after_fixes. In the example below the audit messages are added when adding and editing publications:

  publication-new:
   before_fixes: []
   after_fixes:
      - audit_message

  # Code that runs when editing a new publication
  publication-update:
   before_fixes: []
   after_fixes: 
      - audit_message

The audit messages can be viewed with the librecat audit command:

$ bin/librecat audit list 2555
2018-10-04T06:59:18Z 2555 librecat publication add test

The audit listing about shows that at 06:59:18 the librecat publication process added record 2552 with a log message test.

In the backend web interface the 'Audit' view can be activated by setting the audit parameter in the config/audit.yml configuration file:

audit:1

By default, the command line tools will not add audit messages to the records. Use the --log option to add a descriptive audit message to your commands:

bin/librecat publication --log="mass import" add /tmp/data.yml
bin/librecat publication --log="deleting silly publication" purge 2555
Clone this wiki locally