Setup
-
Firstly, copy
AuditLogintosite/addons/. -
Next, in your
.envfile, 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_logtable in the configured database.
From this point on, any CP content events that are fired by Statamic will be logged in the database.