From d10f9ec53bdbe658d604c6151143ab9c37897ac6 Mon Sep 17 00:00:00 2001 From: Trent Mick Date: Wed, 5 Jun 2013 23:31:13 -0700 Subject: [PATCH] update notes on req_id for restify 2.x changes --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e6ac29f..0ab5a25 100644 --- a/README.md +++ b/README.md @@ -224,12 +224,13 @@ And with the `bunyan` CLI (using the "short" output mode): A more practical example is in the [node-restify](https://github.com/mcavage/node-restify) web framework. Restify uses Bunyan for its logging. One feature of its integration, is that -each restify request handler includes a `req.log` logger that is: +if `server.use(restify.requestLogger())` is used, each restify request handler +includes a `req.log` logger that is: log.child({req_id: }, true) Apps using restify can then use `req.log` and have all such log records -include the unique request id (as "req_id"). Handy. +include the unique request id (as "req\_id"). Handy. ## Serializers @@ -447,7 +448,7 @@ Recommended/Best Practice Fields: for a request. This really shines when you have a SOA with multiple services and you carry a single request ID from the top API down through all APIs (as [node-restify](https://github.com/mcavage/node-restify) facilitates - with its 'X-Request-Id' header). + with its 'Request-Id' header). - `req`: An HTTP server request. Bunyan provides `bunyan.stdSerializers.req` to serialize a request with a suggested set of keys. Example: