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
*`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
37
+
*`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
38
38
*`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
39
39
*`string``$requestHeader` (default `X-Request-Id`) - request header name
40
40
@@ -43,6 +43,10 @@ How to get request id in my application?
43
43
* Middleware implements `RequestIdProviderInterface`, so you are able to use `getRequestId()` method,
44
44
* from `request-id` attribute in `ServerRequest` object (`$request->getAttribute(RequestIdMiddleware::ATTRIBUTE_NAME)`).
45
45
46
+
### Override policy
47
+
48
+
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.
49
+
46
50
### Monolog processor
47
51
48
52
We provide simple [Monolog](https://github.com/Seldaek/monolog)[processor](src/MonologProcessor.php) to add request it to every log entry!
0 commit comments