Skip to content

Commit dade1c1

Browse files
Add logging Rollbar API connectivity problems
1 parent a3dd2d8 commit dade1c1

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/RollbarServiceProvider.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,18 @@ public function boot()
4343
$context = $args[2];
4444
}
4545

46-
$app[RollbarLogHandler::class]->log($level, $message, $context);
46+
if (strpos($message, 'Unable to send messages to Rollbar API. Produced response: ') !== false) {
47+
return;
48+
}
49+
50+
$result = $app[RollbarLogHandler::class]->log($level, $message, $context);
51+
52+
if (!$result->getStatus()) {
53+
\Log::error(
54+
'Unable to send messages to Rollbar API. Produced response: ' .
55+
print_r($result, true)
56+
);
57+
}
4758
});
4859
}
4960

0 commit comments

Comments
 (0)