trentm/node-bunyan

Add extra metada into log record

akravets opened this issue · 1 comments

Hello,

Currently I am only aware of doing this using serializers:
logger.error({ req: request, err: err }, "message");

I'd like to achieve this without needing to pass request object to each log call, but rather set this data when logger is initialized and appear in logs when log is called:

logger = require("lgger")
logger.setId(req.getId())
logger.info("test")

// INFO - 55 - test

Doesn't have to be the exact approach, but some variation of this. Would this be possible with child log feature?