A simple Iron.io Worker that processes the payload received from your Iron.io error queue/s and reports them in Rollbar.com
You need the following:
- Iron.io account & the Iron CLI tool installed
- Rollbar.com account
Run composer:
$ composer install
Setup the iron.json file with your token & project ID:
{"token":"IRON_PROJECT_ID","project_id":"IRON_PROJECT_ID"}
Setup reporter.php with your Rollbar 'Post Server Access Token', you can find this under; Settings > Project Access Tokens.
$config = array(
// required
'access_token' => 'POST_SERVER_ITEM_ACCESS_TOKEN',
// optional - environment name. any string will do.
'environment' => 'iron',
);
Find out more about the Rollbar PHP notifier
Zip the contents of the directory, ready for uploading with the Iron CLI tool:
zip -r example.zip .
You need to ensure you have the iron CLI installed.
To upload the worker package/zip:
iron worker upload --name error-queue-reporter --zip example.zip iron/php php reporter.php
Open up the 'codes' section under your Iron Workers and copy the Webhook URL.
You can do this via Iron front end or via the Iron MQ library, ensure you create a multicast queue and set the 'Subscriber URL' as the 'Webhook URL' from step 5.
More details can be found on the Iron API reference