Fastify plugin for report request data to Graylog (GELF)
Usage
- Declare the input on Graylog WEB UI (support only UDP GELF)
- Install plugin with
npm i fastify-graylog-reporter
- Use.
import { fastifyGrayLogReporter } from 'fastify-graylog-reporter';
fastify.register(fastifyGrayLogReporter, {
host: 'my host',
port: 5555,
facility: `API_${process.env.ENVIRONMENT}`,
});
Gelf query example
{
"version": "1.1",
"host": "example.org",
"short_message": "A short message that helps you identify what is going on",
"full_message": "Backtrace here\n\nmore stuff",
"timestamp": 1385053862.3072,
"level": 1,
"_user_id": 9001,
"_some_info": "foo",
"_some_env_var": "bar"
}