6.0.0 • Published 3 months ago

logger-genesis v6.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
3 months ago

Easy ways to use logs and send them to RabbitMQ using menashmq in your service for TypeScript

Examples

Initialize once

index.ts

import logger from 'logger-genesis';

logger.initialize('systemA', 'serviceA', true, {
    createMenashRabbitMQConnection: true,
    uri: 'amqp://localhost:5672',
    logQueueName: 'log-queue',
});

Usage

import logger from 'logger-genesis';

logger.info(title, message, JSON.stringify(extraFields));

Methods

  • initialize()

  • info()

  • warn()

  • error()

Params

initialize

  • system -> Name of the system

  • service -> Name of the service

  • logQueueName -> Name of the Log's Queue

  • createRabbitConnection -> True if need to create connection to rabbitMQ with menash

  • uri -> Connection URI of rabbitMQ (Needed only if createRabbitConnection is true)

  • retryOptions -> retryOption to connect to RabbitMQ (details in menashmq readme, needed only if createRabbitConnection is true)

logInfo/logWarn/logError

  • title -> Title of the log

  • message -> The message of the log

  • extraFields -> Extra fields that you want to add (Like id, runUID and etc.)

5.0.0

3 months ago

6.0.0

3 months ago

3.2.0

6 months ago

3.1.0

6 months ago

3.0.0

6 months ago

4.0.0

6 months ago

2.2.0

2 years ago

2.1.4

2 years ago

2.1.2

2 years ago

2.1.3

2 years ago

2.1.1

2 years ago

2.1.0

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.1.0

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago