maxmilhas-logger

1.0.10 • Public • Published

Logger

This is an abstraction for winston logger, with this package we can just inform the transporter and it will provide a winston instance configured

Install with:

npm install @maxmilhas/logger

Usage

Local

    import { LoggerFactory } from '@maxmilhas/logger';
    /** logger is an instance of winston with local console as a transporter **/
    const logger = LoggerFactory.create('console', {
      level: 'verbose',
    });

Firehose

    import { LoggerFactory } from '@maxmilhas/logger';
    /** logger is an instance of winston with firehose as a transporter **/
    const logger = LoggerFactory.create('console', {
      level: 'debug',
      name: 'container-name',
      region: 'us-east-1',
      accessKeyId: 'AWS_KEY',
      secretAccessKey: 'AWS_SECRET'
    });

Redis

    import { LoggerFactory } from '@maxmilhas/logger';
    /** logger is an instance of winston with redis as a transporter **/
    const logger = LoggerFactory.create('redis', {
      level: 'verbose',
      container: 'container-name',
      environment: 'homologation',
      host: 'redis-host.com.br',
      port: '6379'
    });

Readme

Keywords

none

Package Sidebar

Install

npm i maxmilhas-logger

Weekly Downloads

5

Version

1.0.10

License

ISC

Unpacked Size

20.5 kB

Total Files

47

Last publish

Collaborators

  • dev-maxmilhas