1.0.6 • Published 3 years ago

centralized-logger v1.0.6

Weekly downloads
3
License
ISC
Repository
github
Last release
3 years ago

Centralized logger v1.0.5

Centralized logger for API development with NodeJs and ExpressJs, based on bunyan & bunyan-express-serializer

Installation

Using npm

In your project folder

$ npm i centralized-logger

Important

Define the environment variables to set the API name and the log level.

example:

Linux =) or MacOS ¬¬

$ export LOG_LEVEL=info

Windows =(

$ set LOG_LEVEL=info

By default they are set as NAME_API=centralized-logger, LOG_LEVEL=info

In nodeJs

In your server file ex. app.js, index.js, server.js, etc...

const log = require("centralized-logger").loggerInstance;
log.info("hi info");
log.error("hi error");

To capture, manage and log all request

const app = express();
require("centralized-logger/instanceLog").capture(app);