You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -339,6 +339,32 @@ $client = new Client([
339
339
Now, your guzzle interactions are fully loggable. Each request, response and even errors would be logged for you.
340
340
You can also set type, as a second argument. Set it to `json` to get auto json decoding for request params and response body.
341
341
342
+
And even more advanced options are the third and the fourth optional arguments, which are callbacks, by which you can minimize your logs if needed.
343
+
Both of them should return bool. `shouldLogRequest` determines if request bodies should be logged or not, and `shouldLogResponse` determines the same for the response bodies.
344
+
You can set here any of your custom logic here. For example, maybe you want to skip logging for just specific urls, or maybe you want to check content length of the response, etc.
0 commit comments