Skip to content

beardon/ldapjs-winston-adapter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ldapjs-winston-adapter

Allows to use Winston logger with ldapjs without Bunyan. Must be used with already installed Winston.

This has been adapted from @gluwer's bunyan-winston-adapter

At the moment it is very simple and its main purpose is to log some Winston internal logs (that expect Bunyan) using the Winston logger. It only supports default Winston log levels derived from NPM.

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

How to use with ldapjs

const LdapjsToWinstonAdapter = require('ldapjs-winston-adapter');

// pass to adapter a winston logger instance (may be whole module if default logger is used)
ldap.createClient({
  log: new LdapjsToWinstonAdapter(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:

const mapping = {
  trace: 'silly'
};

ldap.createClient({
  log: new LdapjsToWinstonAdapter(winston, mapping),
});

License

MIT

About

Allows to use Winston logger with ldapjs without using Bunyan

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published