At the moment whenever you use the report() helper function it will only log the exception if your ExceptionHandler has essentially whitelisted that exception.
This was suprising to us in our application because whenever you're manually calling report() you would expect it to do just that - log the exception. However it wasn't because it was on the dontReport list in the ExceptionHandler
$e = new HttpException(HTTP_CODES::TOO_MANY_REQUESTS, 'Your doing that too fast.');
report($e); // You would expect this to log the exception.
// ...but by default it doesn't because HttpExceptions are not logged.
So would it make more sense to always log exceptions that have been reported manually with report()? This function is practically only used when you are specifically wanting to report an exception. So your logic when to report the exception should surround the report call itself.
At the moment whenever you use the
report()
helper function it will only log the exception if yourExceptionHandler
has essentially whitelisted that exception.This was suprising to us in our application because whenever you're manually calling
report()
you would expect it to do just that - log the exception. However it wasn't because it was on thedontReport
list in theExceptionHandler
So would it make more sense to always log exceptions that have been reported manually with
report()
? This function is practically only used when you are specifically wanting to report an exception. So your logic when to report the exception should surround the report call itself.