This step by step guide explains how you can use the External database & third party integration tools to store the WordPress audit log (also known as audit trail) of multiple WordPress websites on a single MySQL database.
The WordPress Audit Log Database Tables
The WP Security Audit Log uses two tables in the database to store the WordPress activity log:
Note: the wp_ in the table name is a prefix. Every table in your WordPress database has the same prefix. Refer to the WP Security Audit Log database documentation for more details on how the WordPress audit trail is stored.
Store the WordPress Activity Log of Multiple WordPress Websites in One MySQL Database
The concept for this is very simple – when configuring the plugin to store the activity log in the same external database where the activity logs of other sites are stored, specify a different tables prefix for each website.
The other option would be to enable the setting Use the website URL as table prefix when configuring an external database connection so the unique URL of a website is used as a prefix, thus ensuring there are no conflicting table names.
- When configuring the External Database on the website wpwhitesecurity.com we specified wpw as prefix.
- When configuring the External DB add-on on wpsecuritybloggers.com we specified wpsb as prefix.
- Once both websites are configured we will have the following the tables in the MySQL database where the audit logs are stored: