Socket
Socket
Sign inDemoInstall

fastify-graylog-reporter

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastify-graylog-reporter - npm Package Compare versions

Comparing version 1.1.0 to 1.2.0

dist/Gelf/gelfMessageSerializer.d.ts

5

CHANGELOG.md

@@ -1,2 +0,2 @@

# [1.1.0](https://github.com/Blynskyniki/fastify-graylog-reporter/compare/v1.0.0...v1.1.0) (2023-10-12)
# [1.2.0](https://github.com/Blynskyniki/fastify-graylog-reporter/compare/v1.1.0...v1.2.0) (2023-10-12)

@@ -6,3 +6,2 @@

* исправления ([ab31ca5](https://github.com/Blynskyniki/fastify-graylog-reporter/commit/ab31ca58ebe7a173821c3e853374cbb332a6276d))
* исправления ([3c08820](https://github.com/Blynskyniki/fastify-graylog-reporter/commit/3c088200ba6a849ad25367a970a474d014a0f897))
* chunks ([657d91f](https://github.com/Blynskyniki/fastify-graylog-reporter/commit/657d91f816d68dfcffc128b3f156ed6f27ae6c00))

7

dist/Gelf/index.d.ts

@@ -1,2 +0,5 @@

export * from './gelfMessage';
export * from './gelf';
export * from './grayLogGelfReporter';
export * from './options';
export * from './grayLogGelfReporter';
export * from './utils';
export * from './Transport';

@@ -17,4 +17,7 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./gelfMessage"), exports);
__exportStar(require("./gelf"), exports);
__exportStar(require("./grayLogGelfReporter"), exports);
__exportStar(require("./options"), exports);
__exportStar(require("./grayLogGelfReporter"), exports);
__exportStar(require("./utils"), exports);
__exportStar(require("./Transport"), exports);
//# sourceMappingURL=index.js.map
/// <reference types="node" />
import { FastifyPluginCallback } from 'fastify';
export declare const fastifyGrayLogReporter: FastifyPluginCallback<{
facility: string;
host: string;
port?: number | undefined;
}, import("http").Server, import("fastify").FastifyTypeProviderDefault, import("fastify").FastifyBaseLogger>;
export declare const fastifyGrayLogReporter: FastifyPluginCallback<Omit<import("./Gelf").ConnectionOptions, "minCompressSize" | "maxChunkSize"> & Partial<Pick<import("./Gelf").ConnectionOptions, "minCompressSize" | "maxChunkSize">>, import("http").Server, import("fastify").FastifyTypeProviderDefault, import("fastify").FastifyBaseLogger>;

@@ -10,8 +10,21 @@ "use strict";

const plugin = function (fastify, options, done) {
const { facility, port, host } = options;
const instance = new Gelf_1.Gelf(host, port);
fastify.addHook('onResponse', (request, reply, done) => {
const instance = new Gelf_1.GrayLogGelfReporter(options);
fastify.addHook('onResponse', async (request, reply) => {
const { query, params, body, headers, routerMethod, routerPath } = request;
instance.sendMessage(Gelf_1.GelfMessage.fromJSON(facility, { path: routerPath, method: routerMethod, query, params, body, headers }));
done();
try {
await instance.report({
host: headers.location || 'empty',
timestamp: +new Date(),
short_message: `${routerMethod}:${routerPath} ${JSON.stringify(query || body || {})}`,
path: routerPath,
method: routerMethod,
query,
params,
body,
headers,
});
}
catch (err) {
console.error(err);
}
});

@@ -18,0 +31,0 @@ done();

{
"name": "fastify-graylog-reporter",
"version": "1.1.0",
"version": "1.2.0",
"description": "Fastify plugin for report request data to Graylog",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/Blynskyniki/fastify-graylog-reporter#readme",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc