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

1.1.1 • Public • Published

Express console and fluentd logger

Build Status

Logger is configured to log messages to the console and fluentd.

When creating new logger instance need to pass logLevel and optional fluentConfig.

Fluentd logging is enabled via config.

Usage

const createLogger = require('@vanioinformatika/express-logger').createLogger

const logLevel = 'info'
const fluentConfig = {
  enabled: true,
  tag: 'application tag',
  config: {
    host: 'localhost',
    port: 12345
  }
}

const logger = createLogger(logLevel, fluentConfig)

logger.info('Message')

Examples

Initialize logger only with console logger:

const logger = createLogger('info')

Initialize logger with console and fluent logger:

const logger = createLogger('info', {
  enabled: true,
  tag: 'application-name',
  config: {
    host: 'localhost',
    port: 12345
  }
})

/@vanioinformatika/express-logger/

    Package Sidebar

    Install

    npm i @vanioinformatika/express-logger

    Weekly Downloads

    1

    Version

    1.1.1

    License

    MIT

    Unpacked Size

    41.6 kB

    Total Files

    16

    Last publish

    Collaborators

    • vanioinformatika