Skip to content

Commit 98ba615

Browse files
Updated README.md
1 parent 0f919ab commit 98ba615

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,33 @@ use Illuminate\Support\Facades\Http;
8989
Http::withLogger('some_channel')->get();
9090
```
9191

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+
92119
#### toData()
93120

94121
The class instance will be returned.

0 commit comments

Comments
 (0)