Skip to content

Commit f5ee866

Browse files
lukewaitepleckey
authored andcommitted
feat: Run nameTransaction on router.matched event so that exceptions receive the correct transaction name (#50)
1 parent 7213ce8 commit f5ee866

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Intouch/LaravelNewrelic/NewrelicServiceProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ protected function registerNamedTransactions()
7474
{
7575
$me = $this;
7676
$app = $this->app;
77-
$app['router']->after(
78-
function ( $request, $response ) use ( $me ) {
77+
$app['router']->matched(
78+
function ( ) use ( $me ) {
7979
if (true == $me->app['config']->get( 'newrelic.auto_name_transactions' )) {
8080
$me->app['newrelic']->nameTransaction( $me->getTransactionName() );
8181
}

0 commit comments

Comments
 (0)