Heroku Connect Logging and Maintenance Operations
Last updated 11 September 2017
Table of Contents
The application logging feature is currently in beta: the format of log messages is likely to change in future releases of Heroku Connect.
Heroku Connect can emit log messages to Logplex making them available to your application via the CLI or using logging add-ons. To enable application logging navigate to Settings, Manage Connection and check the Enable Application Logging option.
Log entries follow the standard log format with a source of
app, a dyno of
herokuconnect and a message that contains the log level (
CRITICAL) along with a description of the action being carried out.
An example of the Logplex entries for a reload of the
Contact mapping is shown below:
$ heroku logs --ps herokuconnect 2015-08-27T10:42:06+00:00 app[herokuconnect]: [INFO] RELOAD TABLE contact 2015-08-27T10:42:11+00:00 app[herokuconnect]: [INFO] Clearing table contact for load 2015-08-27T10:42:11+00:00 app[herokuconnect]: [INFO] Loading table contact via SOAP 2015-08-27T10:42:11+00:00 app[herokuconnect]: [INFO] Contact, QUERY, ↷SALESFORCE, 20 rows, (0.30 secs) 2015-08-27T10:42:11+00:00 app[herokuconnect]: [DEBUG] Contact, INSERT, ↓DATABASE, 20 rows, (0.03 secs), [soql] 2015-08-27T10:42:12+00:00 app[herokuconnect]: [DEBUG] Ensuring Heroku Connect triggers exist on contact 2015-08-27T10:42:12+00:00 app[herokuconnect]: [INFO] RELOAD COMPLETE
Salesforce event log
The event log feature is alpha and subject to change without notice.
The Salesforce event log allows you to monitor changes from your Salesforce organization.
To enable the event log navigate to Settings, Manage Connection and check the Enable Event Log option. When this option is enabled data change events received from Salesforce are stored in the
_sf_event_log table: see System tables for more information.
Upgrading your database
Heroku Connect operates continuously on a single database, which requires a few steps in order to upgrade that database and allow sync operations to continue as expected. The upgrade itself is done using a follower database, and these instructions illustrate how Heroku Connect fits into that process.
These steps ensure that the new database is an exact copy of your current database. Heroku Connect will not create tables or transfer data to an empty database, so be sure to follow the proper upgrade process.
Create your follower database and allow it to get mostly caught up with your lead database. This will minimize the amount of downtime required for the upgrade.
Wait for your follower to catch up. Now that Heroku Connect and your application have both stopped writing to your database, the follower can get completely caught up. You can check its status using
Promote the follower to become the new lead database. This will make it accessible as
Resume Heroku Connect using the same process used to pause it in step 2, and bring your application out of maintenance mode. Heroku Connect will automatically pick up the new
DATABASE_URLfor your application and resume synchronization using the new database.
If you’re upgrading from a hobby tier database, you won’t be able to create a follower. Instead, use the PG Copy process instead to copy data into the new database. Simply pause Heroku Connect at the same time as you put your application into maintenance mode, and resume it again when you reactivate your application.
When performing certain tasks, such as upgrading your database, you may want to pause synchronization activity in Heroku Connect. To do this navigate to the Settings tab, Manage Connection and click the Pause button.
Heroku Connect will complete any pending operations before entering the paused state. When your connection is paused then changes to data in the database will continue to be added to the trigger log and changes made in Salesforce will not be polled. Push Topic notifications from for mappings using the streaming mode will also be ignored.
To resume synchronization return to the Settings tab, Manage Connection and click the Resume button. Heroku Connect will enter a recovery state: entries in the trigger log will be processed and pushed to Salesforce and changes made in Salesforce will be retrieved using polling (including those mappings that would normally use the Streaming API).
Any changes made to data in the database or in Salesforce while your connection is paused should automatically be synchronized when your connection is resumed.
Recreating a connection
If you’ve reloaded a sandbox organization or you need to upgrade from a hobby database to a professional one, you’ll need to delete your existing connection and create a new one. You can do that as follows:
- Export your configuration from the Connect Dashboard. Click Settings, then click Import/Export Configuration, then click the Export Configuration button.
- If you have any read/write mappings, make sure you aren’t writing any new data to those tables, and make sure all the mappings are in
DATA_SYNCEDto ensure all your data is present in Salesforce. You may need to click Settings, Manage Connection and click the Pause button to stop activity on the connection.
- Click Settings, Manage Connection, and then click the Delete Connection button at the bottom of the page. This will delete the connection and remove the associated schema from your database.
- Create a new connection from https://elements.heroku.com or
heroku addons:create herokuconnectfrom the command line.
- Authenticate your new connection, and import the config you exported from step 1.
Heroku Connect does not support review apps at this time. While this is the case, we realize that disabling review apps completely would prevent users from being able to create review apps altogether. For this reason, we have left it enabled, despite the lack of full support.
Heroku Connect does not support review apps.
If you do choose to use review apps with Heroku Connect, please be aware that you are very likely to encounter issues with the Heroku Connect integration.