fastify-fluentd

0.2.8 • Public • Published

fastify-fluentd

js-standard-style npm-version

Fastify plugin for fluentd. Under the hood the official fluent/fluent-logger-node module is used.

What is Fluentd?

Fluentd is an open source data collector for unified logging layer. Fluentd allows you to unify data collection and consumption for a better use and understanding of data.

Install

npm i fastify-fluentd --save

Usage

Add it to your project with register and you are done!

const fastify = require('fastify')()
 
fastify.register(require('fastify-fluentd'), {
  prefix: 'debug',
  config: {
    host: 'localhost',
    port: 24224,
    timeout: 3.0,
    reconnectInterval: 600000
  }
})
 
fastify.get('/user/:id', function (req, reply) {
  this.fluentd.emit('user', { request: req.params.id })
})
 
fastify.listen(3000, err => {
  if (err) throw err
})

License

Licensed under MIT.

Readme

Keywords

Package Sidebar

Install

npm i fastify-fluentd

Weekly Downloads

8

Version

0.2.8

License

MIT

Unpacked Size

5.14 kB

Total Files

9

Last publish

Collaborators

  • davide.dantonio