hapijs/hapi — pull request #2059 by jeffbski (2014-10-28 14:25:14+00:00)
Title: Allow request ID generator to be configurable

Provide ability to customize the request ID generator using new server setting `idGenerator`. Move existing id generator as the default built-in generator and provide an additional generator which includes hostname and uses a counter to prevent collisions.

- `idGenerator` - controls how the `request.id` is generated. Set this to the string name of a built-in generator or provide a function which returns the `request.id`

- `epochms-pid-random` - unix time (in milliseconds since epoch) - process pid - 5 digit random number between 0 and 65536. Ex: 1414402825896-6691-5132 (Default generator)
- `epochms-hostname-pid-counter` - unix time (in milliseconds since epoch) - hostname - process pid - 5 digit counter (starts at 10000, increments by 1 for each use, rolls over at 99999). Ex: 1414402825896-server1-6691-12345
- `fn(now)` - if a function is provided, the value it returns will be used for the `request.id`. The function may use the `now` parameter which contains the result of Date.now() to create its result.