trentm/node-bunyan — pull request #169 by parshap (2014-09-25 19:54:21+00:00)
Title: Request Serializer: Use req.originalUrl over req.url

Sometimes `req.url` is modified for the purpose of routing [1]. In these cases the convention is to set `req.originalUrl` to the url originally requested [2]. When logging, it's more useful to have the full original url than it is to have the current state of `req.url` as it will depend on where in the routing chain you are.

This changes `bunyan.stdSerializers.req` to prefer using `req.originalUrl` over `req.url` when available.

This change is backwards compatible and should only change the minor (maybe patch) version.

[1] https://github.com/strongloop/express/blob/728917164cc00dd02382560f52c6f78936adb4c3/lib/router/index.js#L251
[2] https://github.com/strongloop/express/blob/728917164cc00dd02382560f52c6f78936adb4c3/lib/router/index.js#L163