File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1212use Illuminate \Routing \Events \RouteMatched ;
1313use Illuminate \Contracts \Events \Dispatcher ;
1414use Illuminate \Database \Events \QueryExecuted ;
15+ use Illuminate \Console \Events \CommandStarting ;
16+ use Illuminate \Console \Events \CommandFinished ;
1517
1618class SentryLaravelEventHandler
1719{
@@ -32,6 +34,9 @@ class SentryLaravelEventHandler
3234
3335 'Illuminate\Queue\Events\JobProcessed ' => 'queueJobProcessed ' , // since Laravel 5.2
3436 'Illuminate\Queue\Events\JobProcessing ' => 'queueJobProcessing ' , // since Laravel 5.2
37+
38+ 'Illuminate\Console\Events\CommandStarting ' => 'commandStarting ' , // Since Laravel 5.5
39+ 'Illuminate\Console\Events\CommandFinished ' => 'commandFinished ' , // Since Laravel 5.5
3540 );
3641
3742 /**
@@ -277,4 +282,28 @@ protected function queueJobProcessingHandler(JobProcessing $event)
277282 'data ' => $ job ,
278283 ]);
279284 }
285+
286+ /**
287+ * Since Laravel 5.5
288+ *
289+ * @param \Illuminate\Console\Events\CommandStarting $event
290+ */
291+ protected function commandStartingHandler (CommandStarting $ event )
292+ {
293+ $ this ->client ->tags_context (array (
294+ 'command ' => $ event ->command ,
295+ ));
296+ }
297+
298+ /**
299+ * Since Laravel 5.5
300+ *
301+ * @param \Illuminate\Console\Events\CommandFinished $event
302+ */
303+ protected function commandFinishedHandler (CommandFinished $ event )
304+ {
305+ $ this ->client ->tags_context (array (
306+ 'command ' => null ,
307+ ));
308+ }
280309}
You can’t perform that action at this time.
0 commit comments