Socket
Socket
Sign inDemoInstall

bunyan-winston-adapter

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    bunyan-winston-adapter

Allows to use winston logger in restify server without really using bunyan.


Version published
Weekly downloads
236
increased by1.72%
Maintainers
1
Install size
4.37 kB
Created
Weekly downloads
 

Readme

Source

bunyan-winston-adapter

Allows to use winston logger in restify server without bunyan. Must be used with already installed winston.

At the moment is is very simple and its main purpose is to log some restify internal logs (that expect bunyan) using winston logger. It only supports default winston log levels.

Level trace is mapped to debug and level fatal is mapped to error.

How to use with restify

var bunyanToWinstonAdapter = require('bunyan-winston-adapter');

// pass to adapter a winston logger instance (may be whole module if default logger is used)
restify.createServer({
  log: bunyanToWinstonAdapter.createAdapter(winston),
});

It is also possible to provide your own mapping from bunyan to winston. This will override default mapping. You can provide only the types you want to override:

var mapping = {
  trace: 'silly'
};

restify.createServer({
  log: bunyanToWinstonAdapter.createAdapter(winston, mapping),
});

Why not add a logger to bunyan that pushes to winston?

I do not want to have some things passed from one logger to another which will be slower and amount of code in both cases is similar.

License

MIT

Keywords

FAQs

Last updated on 01 Aug 2013

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc