Skip to content

Instantly share code, notes, and snippets.

View brianr's full-sized avatar

Brian Rue brianr

View GitHub Profile
diff --git a/rollbar.php b/rollbar.php
index d36a09c..d392102 100644
--- a/rollbar.php
+++ b/rollbar.php
@@ -663,6 +663,9 @@ class RollbarNotifier {
$url = $this->base_api_url . $action . '/';
$ch = curl_init();
+ curl_setopt($ch, CURLOPT_VERBOSE, true);
+ // add the following only if on php 5.3.2 or higher
diff --git a/rollbar.php b/rollbar.php
index d36a09c..d392102 100644
--- a/rollbar.php
+++ b/rollbar.php
@@ -663,6 +663,9 @@ class RollbarNotifier {
$url = $this->base_api_url . $action . '/';
$ch = curl_init();
+ curl_setopt($ch, CURLOPT_VERBOSE, true);
+ // add the following only if on php 5.3.2 or higher
<?php
require_once('rollbar.php');
class EchoLogger {
public function log($level, $message) {
echo "[Rollbar] $level $message\n";
}
}
@brianr
brianr / test.html
Created April 1, 2013 22:48
bare bones rollbar test page
<html>
<head>
<script>
var _rollbarParams = {"server.environment": "production"};
_rollbarParams["notifier.snippet_version"] = "2"; var _rollbar=["client-side-token-here", _rollbarParams]; var _ratchet=_rollbar;
(function(w,d){w.onerror=function(e,u,l){_rollbar.push({_t:'uncaught',e:e,u:u,l:l});};var i=function(){var s=d.createElement("script");var
f=d.getElementsByTagName("script")[0];s.src="//d37gvrvc0wt4s1.cloudfront.net/js/1/rollbar.min.js";s.async=!0;
f.parentNode.insertBefore(s,f);};if(w.addEventListener){w.addEventListener("load",i,!1);}else{w.attachEvent("onload",i);}})(window,document);
</script>
{
"event_name": "reactivated_item",
"data": {
"item": {
"status": 1,
"environment": "development",
"counter": 766,
"hash": "8a2dca9cc02fb27deee9dda24acb15532ee73dce",
"integrations_data": {},
"title": "NameError: undefined local variable or method `bar' for #<HomeController:0x00000103ce4380>",
function runTest() {
console.log("making ajax call");
$.ajax({
url: "/failing"
}).fail(function(result) {
console.log("in fail");
console.log("_rollbar:", _rollbar);
return _rollbar.push('TEST', function() {
console.log("in callback");
return alert('TEST');
@brianr
brianr / Gemfile
Created October 30, 2013 21:16
Example of adding `report_message_with_person` to the Rollbar class so you can send person data (which will be indexed) with a `report_message`-like call. To use, put both files in a directory somewhere and: bundle install bundle exec ruby report_message_with_person.rb
source 'https://rubygems.org'
gem 'rollbar'
@brianr
brianr / gist:8360549
Created January 10, 2014 19:10
rollbar.js - ignore errors that aren't from a given domain (using rollbar.js version 0.10.8)
_rollbarConfig = {
"server.environment": "production",
// any other existing config...
checkIgnore: function(errMsg, file, line, col, err) {
// this function is called for all uncaught errors
// if it returns true, the error will be ignored
// instead of being reported to Rollbar.
if (file && !file.match(/^https?:\/\/www\.mycompany\.com/)) {
// has a filename, but filename (url) is not on www.mycompany.com.
@brianr
brianr / Gemfile
Created March 14, 2014 22:27
Example showing how to report an exception to Rollbar with a custom fingerprint, from ruby
source 'https://rubygems.org'
gem 'rollbar'
@brianr
brianr / payload.json
Last active August 29, 2015 13:57
Example Rollbar payload with arguments in stack frames
{
"access_token": "token here",
"data": {
"body": {
"trace": {
"exception": {"class": "MyException", "message": "The message"},
"frames": [
{
"filename": "foo.erl",
"method": "do_foo",