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
When using the PSR-3 LoggerInterface implementation \Rollbar\RollbarLogger directly in a class to log certain exceptions, Rollbar doesn't respect the exception array key in the context parameter, the exception has to be passed as message to see the pretty stack trace in the Rollbar web interface.
Although technically this is ok, because PSR-3 states that Every method accepts a string as the message, or an object with a __toString() method. and the Exception (and Throwable) class has a __toString() method, it would be nice to also be able to pass the exception via the $context['exception'] key and use a string as $message. PSR-3 defines that behavior explicitly.
So the following code snippets should log the same thing in Rollbar:
When using the PSR-3
LoggerInterface
implementation\Rollbar\RollbarLogger
directly in a class to log certain exceptions, Rollbar doesn't respect theexception
array key in thecontext
parameter, the exception has to be passed asmessage
to see the pretty stack trace in the Rollbar web interface.Although technically this is ok, because PSR-3 states that
Every method accepts a string as the message, or an object with a __toString() method.
and theException
(andThrowable
) class has a__toString()
method, it would be nice to also be able to pass the exception via the$context['exception']
key and use a string as$message
. PSR-3 defines that behavior explicitly.So the following code snippets should log the same thing in Rollbar:
Thanks :)
The text was updated successfully, but these errors were encountered: