0.0.5 • Published 4 years ago

shieldfy-logger v0.0.5

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

shieldfy-logger

winston and winston-elasticsearh based logger client for log streaming

Requirements

this package requires node >= 8.0.0

Installing

Using npm:

$ npm install shieldfy-logger

Using yarn:

$ yarn add shieldfy-logger

Example

// import the package
const shieldfyLogger = require('shieldfy-logger');

// initialize the logger
const logger = shieldfyLogger({ service: 'test-service', host:'http://localhost:9200', env: 'development'})

// const logger = shieldfyLogger({ service: 'test-service' })

// start sending logs :)
logger.info('test info log', { staus: 'success' })

logger.error('test error log',  { staus: 'error' })

note: if you want to attach data , pass it in the second parameter. If you pass it by the first parameter it will be strignified and mutated.

Parameters

parameterrequireddefualtdescription
servicetrue_service name
hostfalseprocess.env.ELASTICSEARCH_HOSTelastic search host
envfalseprocess.env.APP_ENVthe run environment

Contributions

Feel free to fork the repo and submit a PR :)

License

MIT

0.0.5

4 years ago

0.0.3

4 years ago

0.0.4

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago