A few customized serializers for the bunyan logging framework
Some customized serializers for bunyan.
var serializers = require'bunyan-serializers';var bunyan = require'bunyan';var logger = bunyancreateLoggerserializers: serializersstream: processstdoutname: 'test';var server = httpcreateServerlogger.inforeq: req res: res 'Got a request and a response';;serverlisten8080;
In the standard serializer for bunyan the req- and res-objects are serialized when creating a child-logger, like
var child = bunyanchildreq: reqObjres: resObj;
This means that that if the reqObj or resObj get changed after the child has been initated those changes will not be logged properly. The serializers for req and res-objects are in this project not serialized when a child is created but rather when you actually log.
A serializer for an err-object is also attached for completeness.