aob-logger-wrapper
v1.0.10
Published
Wrapper for common logger in node.js microservices
Downloads
194
Readme
Usage
$ import logger from 'aob-logger-wrapper' or import { createLogger } from 'aob-logger-wrapper' // With ES6/Babel
$ const logger = require('aob-logger-wrapper') // With ES5
This package exposes following methods | Method | Description | Params | ------ | ------ | ------ | | createLogger | Create Logger Instance | { appName, logLevel, logStreams, logSerializers, logSrc, offset, timezone, appVersion}; | getLogger | Get the logger instance which was created using createLogger method | n/a | getLoggerLevel | Get the logger level | | setLoggerLevel | Set Logger level | Either 'INFO', 'ERROR' | logInfo | log info message | {code, message, req, res, correlationId, deviceInfo, timestamp} | logError | log error message | { code, error, req, res, correlationId, timestamp, message, deviceInfo }