0.0.4 • Published 4 years ago

@bookmate/preconfigured-winston-logger v0.0.4

Weekly downloads
11
License
ISC
Repository
github
Last release
4 years ago

@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).

0.0.4

4 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago