Setup
-
Firstly, copy
AuditLog
intosite/addons/
. -
Next, in your
.env
file, add the following variables to hook Statamic up to a database:
DB_HOST=localhostDB_DATABASE=database-nameDB_USERNAME=usernameDB_PASSWORD=password
- Finally, from the command line run
php please auditlog:migration
, followed byphp please migrate
. You should now see a newaudit_log
table in the configured database.
From this point on, any CP content events that are fired by Statamic will be logged in the database.