You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
try {
//something that throws an exception
} catch (\Exception$ex) {
$this->logger->error($e);
}
The exception trace doesn't have any colors and it is different than letting rollbar error_reporting to handle the exceptions (without catching the exception).
If I throw the exception without catching it, the result is a more complete exception trace w/ colors.
It looks like when error_reporting catches the exception, it executes the DataBuilder to fill the log with more info.
The text was updated successfully, but these errors were encountered:
This is a result of using PsrHandler instead of RollbarHandler. Unfortunately, it is the best thing you can do as of right because RollbarHandler is heavily outdated and doesn't work with our latest releases.
I submitted a PR to Monolog repo long time ago with code changes to update RollbarHandler, but they still have not processed my PR. In meantime, I suggest you look into using this Mononolog PR: Seldaek/monolog#1042
More details on PsrHandler: PsrHandler::handle on line 52 packs the Exception object into $record['message'] and converts it to a string
This way the Exeception object is passed to RollbarLogger::log as a string and formatted in the JSON payload as a message instead of an Exception object.
I'm currently using monolog and new relic handler:
When I try to log the exception using:
The exception trace doesn't have any colors and it is different than letting rollbar error_reporting to handle the exceptions (without catching the exception).
If I throw the exception without catching it, the result is a more complete exception trace w/ colors.
It looks like when error_reporting catches the exception, it executes the DataBuilder to fill the log with more info.
The text was updated successfully, but these errors were encountered: