centralized-logger

1.0.6 • Public • Published

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);

Readme

Keywords

Package Sidebar

Install

npm i centralized-logger

Weekly Downloads

0

Version

1.0.6

License

ISC

Unpacked Size

3.24 kB

Total Files

4

Last publish

Collaborators

  • luispe