celysium / logger
There is no license information available for the latest version (v1.24) of this package.
v1.24
2023-12-03 06:25 UTC
Requires
- php: ^8.1
- celysium/authenticate: ^1.10
- laravel/framework: ^10.0
- mongodb/laravel-mongodb: ^4.0
Requires (Dev)
- orchestra/testbench: ^8.15
README
Log Http Request,Response,Exception
for store http request and response into collection request_log in mongo db use macro loggable
before:
Http::withBasicAuth(env('USERNAME'), env('PASSWORD'))
->withHeaders(
[
'Accept' => 'application/json',
'Content-Type' => 'application/json',
]
)
->baseUrl(env('BASE_URL'))
->get('')
->onError(function ($response) {
throw new BadRequestHttpException($response);
})
->json();
after:
Http::loggable('name')->withBasicAuth(env('USERNAME'), env('PASSWORD'))
->withHeaders(
[
'Accept' => 'application/json',
'Content-Type' => 'application/json',
]
)
->baseUrl(env('BASE_URL'))
->get('')
->onError(function ($response) {
throw new BadRequestHttpException($response);
})
->json();