Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bunyan-serializers

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bunyan-serializers

A few customized serializers for the bunyan logging framework

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

bunyan-serializers

Some customized serializers for bunyan.

example

    var serializers = require('bunyan-serializers');
    var bunyan = require('bunyan');

    var logger = bunyan.createLogger({
        serializers: serializers,
        stream: process.stdout,
        name: 'test'
    });

    var server = http.createServer(function(req, res) {
        logger.info({req: req, res: res}, 'Got a request and a response');
    });
    server.listen(8080);

differences from bunyan.stdSerializers.

In the standard serializer for bunyan the req- and res-objects are serialized when creating a child-logger, like

    var child = bunyan.child({
        req: reqObj,
        res: 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.

Keywords

FAQs

Package last updated on 27 Jan 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc