Skip to content

Commit 8005c3d

Browse files
committed
Update docs
1 parent 150dc97 commit 8005c3d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ $app->run($request, $response);
2929
All middleware constructor options:
3030

3131
* `PhpMiddleware\RequestId\Generator\GeneratorInterface` `$generator` - generator implementation (required)
32-
* `bool` `$allowOverride` (default `true`) - if `true` and request id header exists in incoming request, then value from request header will be used in middleware, using generator will be avoid
32+
* `bool|PhpMiddleware\RequestId\OverridePolicy\OverridePolicyInterface` `$allowOverride` (default `true`) - if `true` and request id header exists in incoming request, then value from request header will be used in middleware, using generator will be avoid
3333
* `string` `$responseHeader` (default `X-Request-Id`) - request id will be added to response as header with given name. If it's not string request id will be not added to response
3434
* `string` `$requestHeader` (default `X-Request-Id`) - request header name
3535

@@ -38,6 +38,10 @@ How to get request id in my application?
3838
* Middleware implements `RequestIdProviderInterface`, so you are able to use `getRequestId()` method,
3939
* from `request-id` attribute in `ServerRequest` object (`$request->getAttribute(RequestIdMiddleware::ATTRIBUTE_NAME)`).
4040

41+
### Override policy
42+
43+
You can add your own logic to decide when override incoming request id. You can implement `OverridePolicyInterface` and pass it as `$allowOverride` variable in constructor.
44+
4145
### Monolog processor
4246

4347
We provide simple [Monolog](https://github.com/Seldaek/monolog) [processor](src/MonologProcessor.php) to add request it to every log entry!

0 commit comments

Comments
 (0)