From 3aa0d9145c230999f64c5c906a19acb298c9875b Mon Sep 17 00:00:00 2001 From: Steve McDougall Date: Fri, 11 Oct 2024 12:58:43 +0100 Subject: [PATCH 1/2] fix: force fix a config error --- src/Middlewares/TreblleMiddleware.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Middlewares/TreblleMiddleware.php b/src/Middlewares/TreblleMiddleware.php index c420e14..20f6b9b 100644 --- a/src/Middlewares/TreblleMiddleware.php +++ b/src/Middlewares/TreblleMiddleware.php @@ -67,7 +67,7 @@ public function terminate(Request $request, JsonResponse|Response|SymfonyRespons } Treblle::log( - endpoint: config('treblle.endpoint', Endpoint::random()), + endpoint: config('treblle.url', Endpoint::random()), data: $this->factory->make( request: $request, response: $response, From 6320c4735688bb4543bbd434d729ddb2ed7b7908 Mon Sep 17 00:00:00 2001 From: Steve McDougall Date: Fri, 11 Oct 2024 13:17:06 +0100 Subject: [PATCH 2/2] feature: adding laravel about command info to help debug --- src/TreblleServiceProvider.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/TreblleServiceProvider.php b/src/TreblleServiceProvider.php index 6aab90e..5f51b67 100644 --- a/src/TreblleServiceProvider.php +++ b/src/TreblleServiceProvider.php @@ -7,6 +7,7 @@ use Illuminate\Contracts\Container\BindingResolutionException; use Illuminate\Contracts\Support\DeferrableProvider; use Illuminate\Events\Dispatcher; +use Illuminate\Foundation\Console\AboutCommand; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Http; use Illuminate\Support\ServiceProvider; @@ -16,6 +17,8 @@ use Treblle\Commands\SetupCommand; use Treblle\Contracts\TreblleClientContract; use Treblle\Utils\Masking\FieldMasker; +use function config; +use function implode; final class TreblleServiceProvider extends ServiceProvider implements DeferrableProvider { @@ -55,6 +58,17 @@ public function boot(): void Cache::store('octane')->put($uuid, microtime(true)); }); } + + AboutCommand::add( + section: 'Treblle', + data: static fn (): array => [ + 'Version' => Treblle::VERSION, + 'URL' => config('treblle.url'), + 'Project ID' => config('treblle.project_id'), + 'API Key' => config('treblle.api_key'), + 'Ignored Environments' => config('treblle.ignore_environments'), + ], + ); } /**