1.3.12 • Published 3 years ago

eyecontrol-web-logger v1.3.12

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

eyecontrol web-logger

A web logger service for node.js

Motivation

Eyecontrol-web-logger is designed to be simple and universal logging with support for multiple transports(winston and logz.io). Each instance can have multiple transports configured at different levels.

Quick installation

    npm i eyecontrol-web-logger

Usage

Instantiante the logger

In order to use the web-logger, you need to instantiate it with different parameters:

    const webLogger = require('eyecontrol-web-logger');
    const config = require('./config/config');

    const log = webLogger.createLogger({
        application: config.LOGZ_APPLICATIONS.SERVER,
        loggers: {
            winston: {
                activated: true
            },
            logzIo: {
                activated: true,
                token: 'xxxxxxxxxxxxxxxxxx',
                host: 'xxxxxxxxxxxxxxxxx'
            }
        }
    });

P.S: We recommand to instantiante it one time in a controller/service, and then export it.

Usage

After you instantianted the web-logger, you can work with it like with a classic logger. You need to call an instance of the logger and send 4 parameters: source, message, userEmail, deviceId.

    log.info("init", "init bluetooth connection...", "user@example.com", deviceId);

Logging levels

Three different levels: error, info, warn.

    log.error("getJson", err, "user@example.com", deviceId);
    log.info("init", "connect to bluetooth...", "user@example.com", deviceId);
    log.warn("fetchJson", "device undefined, get default json", "user@example.com", deviceId);

Installation

Installing npm (node package manager)

  curl https://npmjs.org/install.sh | sh

Installing eyecontrol-web-logger

  [sudo] npm install eyecontrol-web-logger

Author: Eyecontrol

Contributors: Yohann

1.3.7

3 years ago

1.3.6

3 years ago

1.3.5

3 years ago

1.3.10

3 years ago

1.3.11

3 years ago

1.3.12

3 years ago

1.3.9

3 years ago

1.3.8

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.9

5 years ago

1.2.8

5 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.8

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago