Skip to content

Latest commit

 

History

History
31 lines (19 loc) · 895 Bytes

README.md

File metadata and controls

31 lines (19 loc) · 895 Bytes

Logger configured for Node.js • Actions Status

Simple package exposing and configuring a logger for nodejs services, based on log4js.

The logger can be configured via the LOG_LEVEL environment variable.

Usage

Logger initialization

On the bootstrap of your application, just call the init() function:

const { init } = require('wed-nodejs-logger');

init();

Log data

To log a data, you have to create the logger with a context and call the right function:

const { getLogger } = require('wed-nodejs-logger');

const logger = getLogger('File context');

logger.info('This is an informative message.');
logger.warn('Something is not really good.');
logger.error('Something\'s wrong!');