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 1010use Illuminate \Routing \Events \RouteMatched ;
1111use Illuminate \Contracts \Events \Dispatcher ;
1212use Illuminate \Database \Events \QueryExecuted ;
13+ use Illuminate \Console \Events \CommandStarting ;
14+ use Illuminate \Console \Events \CommandFinished ;
1315
1416class SentryLaravelEventHandler
1517{
@@ -27,6 +29,9 @@ class SentryLaravelEventHandler
2729
2830 'illuminate.log ' => 'log ' , // Until Laravel 5.3
2931 'Illuminate\Log\Events\MessageLogged ' => 'messageLogged ' , // Since Laravel 5.4
32+
33+ 'Illuminate\Console\Events\CommandStarting ' => 'commandStarting ' , // Since Laravel 5.5
34+ 'Illuminate\Console\Events\CommandFinished ' => 'commandFinished ' , // Since Laravel 5.5
3035 );
3136
3237 /**
@@ -234,4 +239,28 @@ protected function authenticatedHandler(Authenticated $event)
234239 'id ' => $ event ->user ->getAuthIdentifier (),
235240 ));
236241 }
242+
243+ /**
244+ * Since Laravel 5.5
245+ *
246+ * @param \Illuminate\Console\Events\CommandStarting $event
247+ */
248+ protected function commandStartingHandler (CommandStarting $ event )
249+ {
250+ $ this ->client ->tags_context (array (
251+ 'command ' => $ event ->command ,
252+ ));
253+ }
254+
255+ /**
256+ * Since Laravel 5.5
257+ *
258+ * @param \Illuminate\Console\Events\CommandFinished $event
259+ */
260+ protected function commandFinishedHandler (CommandFinished $ event )
261+ {
262+ $ this ->client ->tags_context (array (
263+ 'command ' => null ,
264+ ));
265+ }
237266}
You can’t perform that action at this time.
0 commit comments