File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 44
55- Add ` send_default_pii ` option by default to published config file (#340 )
66- Update ` .gitattributes ` to exclude more files from dist release (#341 )
7+ - Ignore log breadcrumbs when ` null ` is the message logged (#345 )
78- Fixed scope data in queue jobs being lost in some cases (#351 )
89
910## 1.7.1
Original file line number Diff line number Diff line change @@ -313,16 +313,23 @@ protected function messageLoggedHandler(MessageLogged $logEntry)
313313 /**
314314 * Helper to add an log breadcrumb.
315315 *
316- * @param string $level Log level. May be any standard.
317- * @param string $message Log message.
318- * @param array $context Log context.
316+ * @param string $level Log level. May be any standard.
317+ * @param string|null $message Log message.
318+ * @param array $context Log context.
319319 */
320- private function addLogBreadcrumb (string $ level , string $ message , array $ context = []): void
320+ private function addLogBreadcrumb (string $ level , ? string $ message , array $ context = []): void
321321 {
322322 if (!$ this ->recordLaravelLogs ) {
323323 return ;
324324 }
325325
326+ // A log message with `null` as value will not be recorded by Laravel
327+ // however empty strings are logged so we mimick that behaviour to
328+ // check for `null` to stay consistent with how Laravel logs it
329+ if ($ message === null ) {
330+ return ;
331+ }
332+
326333 Integration::addBreadcrumb (new Breadcrumb (
327334 $ this ->logLevelToBreadcrumbLevel ($ level ),
328335 Breadcrumb::TYPE_DEFAULT ,
You can’t perform that action at this time.
0 commit comments