diff --git a/website/content/middleware/request-id.md b/website/content/middleware/request-id.md index 64c45ea2..bcc21298 100644 --- a/website/content/middleware/request-id.md +++ b/website/content/middleware/request-id.md @@ -45,3 +45,17 @@ DefaultRequestIDConfig = RequestIDConfig{ Generator: generator, } ``` + +## Set ID + +You can set the id from the requester with the `X-Request-ID`-Header + +*request* +``` +curl -H "X-Request-ID: 3" --compressed -v "http://localhost:1323/?my=param" +``` + +*Log* +``` +{"time":"2017-11-13T20:26:28.6438003+01:00","id":"3","remote_ip":"::1","host":"localhost:1323","method":"GET","uri":"/?my=param","my":"param","status":200, "latency":0,"latency_human":"0s","bytes_in":0,"bytes_out":13} +```