Using laravel’s logging channels with sentry

smknstd
smknstd
Mar 13 · 3 min read
Photo by Keagan Henman on Unsplash

New features

Laravel + sentry

Keep track of channels

Log::channel('stripe')->warning(
'Couldn't capture: auth has expired',
[
'context' => $contextArray
]
);
<?php

return
[

'channels' => [
...

'stripe' => [
'driver' => 'stack',
'channels' => ['stripe_file', 'sentry'],
'name' => 'stripe' //this is the key used by sentry!
],

'stripe_file' => [
'driver' => 'daily',
'path' => storage_path('logs/stripe.log'),
'level' => 'debug',
'days' => 30,
],

'sentry' => [
'driver' => 'sentry',
'level' => 'warning'
],
],

];

Keep calm and filter

Screenshot from stripe related issues filtered with the logger attribute on sentry’s interface

code16

About open source projects at CODE 16

smknstd

Written by

smknstd

Coder at Code16

code16

code16

About open source projects at CODE 16