by Anonymous » 24 Aug 2025, 00:13
Ich muss im Big -Projekt wie folgt Protokoll nach dem Anruf für Anrufe hinzufügen: < /p>
Code: Select all
$response = Http::get('http://example.com');
Log::info(`add request and header and response`);
< /code>
Ich möchte das globale Protokoll für alle HTTP -Anforderungen definieren. \Illuminate\Support\Facades\Http::macro('log',function(){
Log::info(`add request and header and response`);
});
< /code>
und rufen Sie die HTTP -Anforderung wie folgt auf: < /p>
$response = Http::get('http://example.com')->log();
Ich muss im Big -Projekt wie folgt Protokoll nach dem Anruf für Anrufe hinzufügen: < /p>
[code]$response = Http::get('http://example.com');
Log::info(`add request and header and response`);
< /code>
Ich möchte das globale Protokoll für alle HTTP -Anforderungen definieren. \Illuminate\Support\Facades\Http::macro('log',function(){
Log::info(`add request and header and response`);
});
< /code>
und rufen Sie die HTTP -Anforderung wie folgt auf: < /p>
$response = Http::get('http://example.com')->log();
[/code]