Simple package exposing and configuring a logger for nodejs services, based on log4js.
The logger can be configured via the LOG_LEVEL
environment variable.
On the bootstrap of your application, just call the init()
function:
const { init } = require('wed-nodejs-logger');
init();
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!');