@storyous/logger
TypeScript icon, indicating that this package has built-in type declarations

1.0.9 • Public • Published

logger

Usage

import { initLogger } from '@storyous/logger';

const config = {
    env: process.env.NODE_ENV,
    logging: {
        console: {
            colorize: true,
            
            // Use for localhost development only, it will output nicely readable logs
            // and if error appears the stack will be clickable in webstorm
            prettyOutput: true,
        },
        loggly: {
            silent: true,
            token: process.env.LOGGLY_TOKEN || '',
            subdomain: 'storyous',
            tags: ['serviceName', process.env.NODE_ENV],
            json: true
        },
        sentry: {
            dsn: process.env.SENTRY_DSN || '',
            level: 'error',
            silent: true
        }
    }
}

const logger = initLogger(config.env, config.logging);

// define new logger for specific module
const logModule = logger.module('extraLogger');

export default logger;

Readme

Keywords

none

Package Sidebar

Install

npm i @storyous/logger

Weekly Downloads

28

Version

1.0.9

License

ISC

Unpacked Size

50.8 kB

Total Files

5

Last publish

Collaborators

  • danieldadateya
  • nte-saltpay
  • mkoubik
  • storyous-user
  • vaclav.obornik
  • tymak
  • ivo.sofranek