0

I would like to dump the complete report sent to Bugsnag in Ruby.

I tried this:

Bugsnag.before_notify_callbacks << lambda {|report|
     puts report
}

But the only result I get is the following:

#<Bugsnag::Report:0x000055d8ab22f310>

I also tried puts report.to_json with (require 'json' of course), same result.

I would like to get a json-like dump of the report that is being sent, something like:

stacktrace: "..."
app: {
        releaseStage: "..."
        ...
     }
request: {
     ....
}
my-custom-tag: {
    ...
}

The exact format does not matter, the only important thing is that I'm able to see all the fields. How can I do this?

Attilio
  • 1,624
  • 1
  • 17
  • 27

1 Answers1

0

Looking at the source code of that gem it looks like there is the Report#as_json that returns what you are looking for.

Bugsnag.before_notify_callbacks << lambda { |report|
  puts report.as_json
}
spickermann
  • 100,941
  • 9
  • 101
  • 131