celysium / logger
Installs: 494
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/celysium/logger
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();