@bookmate/preconfigured-winston-logger

0.0.4 • Public • Published

@bookmate/preconfigured-winston-logger

Summary

Common config for Winston logger

Usage

const { getPreconfiguredLogger } = require('@bookmate/preconfigured-winston-logger');

const env = require('env'); // a custom environment information manager

const logger = getPreconfiguredLogger({
  environment: env.getEnvironment()
});

Options of getPreconfiguredLogger

  • environment, optional, — either production or development
  • requestIdGetter, optional, – a function that accepts Express' req object and gets its identifier (relevant only in prod environment)

Note

When using with express-winston, the version of express-winston should be at least 3 (the logger is expecting the Express request object to be passed to it in the meta field, which was added only in this commit).

Readme

Keywords

none

Package Sidebar

Install

npm i @bookmate/preconfigured-winston-logger

Weekly Downloads

26

Version

0.0.4

License

ISC

Unpacked Size

2.99 kB

Total Files

3

Last publish

Collaborators

  • andorn
  • bookmate-npm