Search for answers or browse our knowledge base.
How to mirror the WordPress activity log to Loggly
The WP Activity Log plugin can be configured to mirror your WordPress activity log to Loggly, a cloud-based log management and analytics service provider. The WordPress activity log is mirrored to third party services in real time, so you can see what is happening on your site in real time directly from your third party service of choice.
This document explains how you can mirror the activity logs of your WordPress website(s) to Loggly. In short, the process consists of the following steps:
- Create a Customer Token in Loggly
- Set up a Loggly connection in the WP Activity Log plugin
- Configure the mirroring of the activity log to Loggly
1. Create a Customer Token in Loggly
For the plugin to be able to send logs to Loggly you will need a Customer Token. In this section we explain how you can create one. Please note that the below is a basic explanation. For more detailed information about customer tokens in Loggly please refer to the Loggly documentation.
- Navigate to https://[your_subdomain].loggly.com/tokens.
- Click the Add New button next to the Customer Tokens.
- Specify a description and click Save.
- Once the token is created, click the copy icon to copy it so you can use it in the plugin configuration.
2. Create a Loggly connection in the plugin
To setup a Loggly connection in the activity log plugin:
- Navigate to WP Activity Log > Integrations
- Click the Create a Connection button to launch the connection setup wizard.
- Select Loggly from the Type of Connection drop-down menu in the first step of the wizard and click Next.
- Next, the plugin will run automatically run a requirements check. Click Next once completed.
- Paste the Loggly token in the placeholder and click Next.
- When the plugin completes the test, specify a name for the connection. The connection name is the friendly name that is used in the plugin. They can be up to 25 characters long and can only consist of letters, numbers and underscores.
- Click Save Connection to close the wizard.
Testing the Loggly Connection
Once the connection is setup, it will be listed in the Connections tab. Click the Test button to send a test message to the configured service via the plugin and confirm the configuration.
3. Configuring the mirroring of the activity log to Loggly
Once the Loggly connection has been configured, configure the mirroring by following the below instructions:
- Navigate to WP Activity Log > Integrations
- Click on the Mirroring tab and click the Setup an Activity Log Mirror button.
3. In the first step of the wizard specify the following:
- Mirror connection friendly name: A friendly name for the mirror.
- Mirror identifier in logs: This will be added to each event, so you know the source of the activity log event).
- Tags used in the logger: Add a custom tag to the mirrored activity log
- Write directly to destination: Enable this option to skip the buffer. Do make sure the plugin has access to Loggly.
- Connection: Select the Loggly connection you’ve just set up from the Connection drop-down menu.
4. In the second step of the wizard, specify if you want the mirroring to start right away and whether you want to keep a log of events that were not mirrored.
5. In the last step of the wizard, you can configure activity log mirror filtering rules. By default, the connection is set to Send all events. However, if you’d like to set up any filtering rules, refer to configuring filtering rules for activity log mirroring connections.
6. Click Save mirror to save the new mirroring process.
WordPress activity log in your Loggly subdomain
That is it. Now the plugin will send a copy of the activity log events to Loggly as they happen, in real time!
Restrict log writing to mirror only
Once the mirroring setup process is complete, and WP Activity Log has successfully started writing to Loggly, you will have the option to stop writing activity logs to the database. While this will help you prevent redundant data, do keep in mind that the plugin will only write activity logs to the configured mirror(s).
To stop writing activity logs to the database, switch off the Write activity log to database option as available in the Mirroring tab.
More information & other Integrations
Refer to getting started mirroring the WordPress activity log for more information on the format of the logs, the third party services the plugin can mirror activity logs to and other technical details.