PMC Rollbar
This plugin helps load rollbar with proper settings
Cheezcap
The following parameters are avaiable in Cheezcap for rollbar (Settings > Theme Settings > Rollbar)
- Enable or Disable Rollbar? - Set
Enableto enable rollbar - Minimum log level - 'debug' as default value
- Access Token (JS) - Find access token in rollbar.com (see the doc here (opens in a new tab) on where to find access token)
- Access Token (PHP) - post_server_item access token, which you can find in the Rollbar.com interface.
Usage
javascript
Documentation - https://docs.rollbar.com/docs/javascript (opens in a new tab)
// Arbitrary log messages. 'critical' is most severe; 'debug' is least.
Rollbar.critical("Connection error from remote Payments API");
Rollbar.error("Some unexpected condition");
Rollbar.warning("Connection error from Twitter API");
Rollbar.info("User opened the purchase dialog");
Rollbar.debug("Purchase dialog finished rendering");
// Can include custom data with any of the above.
// It will appear as `message.extra.postId` in the Occurrences tab
Rollbar.info("Post published", {postId: 123});
// Callback functions
Rollbar.error(e, function(err, data) {
if (err) {
console.log("Error while reporting error to Rollbar: ", e);
} else {
console.log("Error successfully reported to Rollbar. UUID:", data.result.uuid);
}
});PHP
Documentation - https://docs.rollbar.com/docs/php (opens in a new tab)
<?php
use Rollbar\Rollbar;
use Rollbar\Payload\Level;
Rollbar::log(Level::WARNING, 'could not connect to mysql server');
Rollbar::log(
Level::INFO,
'Here is a message with some additional data',
array('x' => 10, 'code' => 'blue')
);