1.1.0 • Published 12 months ago

@tadashi/graylog v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

@tadashi/graylog

NPM version Node.js CI Coverage Status

Publishing application logs to Graylog.

Install

$ npm i -S @tadashi/graylog

API

Environment variables available

  • TADASHI_GRAYLOG = 1

createLogger(name, [options]): Logger

Type: Logger

name

Type: string

The log's name.

options

Type: object
Default: {}

See the options here:
https://github.com/deepal/node-gelfy#gelfycreateoptions

Usage

import createLogger from '@tadashi/graylog'

const logger = createLogger('example', {
  host: '127.0.0.1'
})

logger.on('error', () => {
  process.stderr.write('error...')
})

logger.info({
  message: 'Show the info',
  custom_prop: '...'
})

License

MIT © Thiago Lagden