Skip to content

Commit 719cad1

Browse files
authored
Update README.md
1 parent ea36da9 commit 719cad1

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,17 @@ public function index(Request $request)
7474
}
7575
```
7676

77-
### Drivers
77+
### Unique Request UUID
78+
79+
This package adds a macro `getUniqueId()` for the `Request` which generates a unique request UUID that will be saved to the logs and that can be included as [Global Log Context](https://laravel.com/docs/8.x/logging#contextual-information) which will pass it onto any application logging or error reporting. This id will per default also be added as a custom response header.
80+
81+
**This is an extremely helpful trick when debugging customer requests as both customer, application logs, reported errors and request logs (this package) now all include a single common UUID!**
82+
83+
```php
84+
$request->getUniqueId(); // Example: 94d0e2d6-4cc6-449c-9140-80bca47d29b4
85+
```
86+
87+
## Extending with custom Drivers
7888

7989
This package implements the [Laravel Manager Class](https://inspector.dev/how-to-extend-laravel-with-driver-based-services/) making it possible to easily register custom drivers either in your application or by third party packages.
8090

@@ -92,16 +102,6 @@ or via request macro:
92102
$request->enableLog('example');
93103
```
94104

95-
### Unique Request UUID
96-
97-
This package adds a macro `getUniqueId()` for the `Request` which generates a unique request UUID that will be saved to the logs and that can be included as [Global Log Context](https://laravel.com/docs/8.x/logging#contextual-information) which will pass it onto any application logging or error reporting. This id will per default also be added as a custom response header.
98-
99-
**This is an extremely helpful trick when debugging customer requests as both customer, application logs, reported errors and request logs (this package) now all include a single common UUID!**
100-
101-
```php
102-
$request->getUniqueId(); // Example: 94d0e2d6-4cc6-449c-9140-80bca47d29b4
103-
```
104-
105105
## Pruning
106106

107107
The number of logged requests can quickly grow if you are not pruning the logs regularly. In order to keep the logs manageable, you can use the `prune` command to remove old logs as [described in the Laravel Docs](https://laravel.com/docs/8.x/eloquent#pruning-models):

0 commit comments

Comments
 (0)