File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,33 @@ use Illuminate\Support\Facades\Http;
89
89
Http::withLogger('some_channel')->get();
90
90
```
91
91
92
+ This method will log HTTP requests and responses.
93
+
94
+ It is also possible to use your own handler, message formatting and path to the log file.
95
+ To do this, you need to specify the desired channel name from the log file and define the necessary parameters in it.
96
+
97
+ For example:
98
+
99
+ ``` php
100
+ // config/logging.php
101
+ return [
102
+ // ...
103
+
104
+ 'channels' => [
105
+ 'some' => [
106
+ 'driver' => 'single',
107
+ 'level' => env('LOG_LEVEL', 'debug'),
108
+ 'path' => storage_path('logs/some.log'),
109
+ 'handler' => \App\Logging\SomeHandlerStack::class,
110
+ 'formatter' => \App\Logging\MessageFormatter::class,
111
+ ],
112
+ ],
113
+ ];
114
+
115
+ // Usage
116
+ return Http::withLogger('some')->...
117
+ ```
118
+
92
119
#### toData()
93
120
94
121
The class instance will be returned.
You can’t perform that action at this time.
0 commit comments