Skip to content

bookmate/preconfigured-winston-logger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published