How to mirror the WordPress activity log to Papertrail

Search Knowledge Base by Keyword

You are here:

Papertrail is a cloud-based log management system to which you can export any type of logs and activity logs. With the WP Activity Log plugin you can also export the activity log of your WordPress websites in real-time to Papertrail, so you can also have the logs of your websites in your central business log management system.

This document explains how to integrate the WP Activity Log plugin with Papertrail to mirror the activity log of WordPress sites to it. The process consists of these simple three steps:

  1. Get the Papertrail log destination URL to where you need to send the logs.
  2. Set up a Papertrail connection in the plugin.
  3. Configure the mirroring of the activity logs to Papertrail.

1. Get the Papertrail log destination URL

To send your websites’ activity log to Papertrail you need the log destination URL. To get this URL:

  1. Navigate to your Papertrail dashboard (https://papertrailapp.com/dashboard).
  2. Click the Add Systems button.
  3. Copy the URL at the top of the window, which is highlighted below. The format of this URL is always as follows: logs[x].papertrail.com:[port_number].

Geting the Papertrail log destination URL

Alternatively, to get the log destination URL, navigate directly to the Log Destinations section of your Papertrail account.

2. Setting up a Papertrail connection

To setup a Papertrail connection in the WP Activity Log plugin follow the below procedure:

  1. Click on the Integrations node in the plugin menu.
  2. Click the Create a Connection button to launch the connection setup wizard.
  3. Select Papertrail from the Type of Connection drop down menu in the first step of the wizard.
  4. Click Next, so the plugin can check the requirements.
  5. When the plugin completes the tests, click Next.

Setting up a Papertrail connection

  1. In the second step of the wizard specify:
  2. Click Next, so the plugin runs a connection test and once complete, click Next.
  3. In the last step of the wizard, specify a name for the connection. Connection names are just a reference for you and can be up to 25 characters long and can only consist of letters, numbers and underscores.

Testing the Papertrail connection

Once the connection is set up 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.

Papertrail activity log test message

Configuring the mirroring of the activity log

Once the Papertrail connection is setup you have to configure it as a mirroring connection as per the below procedure:

  1. Click on Integrations in the plugin menu.
  2. Navigate to the Mirroring tab and click the Setup an Activity Log Mirror button.
  3. In the first step of the wizard specify the following:
    • Friendly name for the mirror.
    • Mirror identifier (this will be added to each event, so you know the source website of the activity log event).
    • Select the Papertrail 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.

Activity log filters for mirroring connections

  1. In the last step of the wizard you can configure activity log filtering rules for the mirroring connection. By default, the connection is set to Send all events option, though if you’d like to setup any filtering rules refer to configuring filtering rules for activity log mirroring connections.
  2. Click Save mirror to save the new mirroring process.

WordPress activity log in Papertrail

That is it. Now the plugin will send a copy of the activity log events to Papertrail as they happen, in real-time!

WordPress activity log in Papertrail

Restrict log writing to mirror only

Once the mirroring setup process is complete, and WP Activity Log has successfully started writing to Papertrail, 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.