Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can i use pino-elasticsearch as a module #24

Closed
guotie opened this issue May 29, 2019 · 3 comments
Closed

can i use pino-elasticsearch as a module #24

guotie opened this issue May 29, 2019 · 3 comments

Comments

@guotie
Copy link
Contributor

guotie commented May 29, 2019

for example:

const pinoms = require('pino-multi-stream')
const pinoEs = require('pino-elasticsearch')({
    host: '192.168.1.220',
    index: 'zb'
})

const logger = pinoms({
    streams: [
      {level: 'error', stream: process.stderr}, // an "error" level destination stream
      {level: 'info', stream: process.stdout}, // an "info" level destination stream
      {stream: pinoEs}
    ]
  })


logger.info({'msg': {'info': 'info'}})
logger.debug('debug')
logger.warn('warn')
logger.error('error')

@mcollina
Copy link
Member

I would love to support that! Would you like to send a PR?

@guotie
Copy link
Contributor Author

guotie commented May 31, 2019

#25

@guotie guotie closed this as completed May 31, 2019
@wennyben
Copy link

for the latest version of pino-elasticsearch,
'node' should be used instead of 'host'

const pinoEs = require('pino-elasticsearch')({ node: '192.168.1.220', index: 'zb' })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants