fastify-graylog-reporter
Advanced tools
Comparing version 1.13.1 to 1.14.0
@@ -1,6 +0,6 @@ | ||
## [1.13.1](https://github.com/Blynskyniki/fastify-graylog-reporter/compare/v1.13.0...v1.13.1) (2023-11-21) | ||
# [1.14.0](https://github.com/Blynskyniki/fastify-graylog-reporter/compare/v1.13.1...v1.14.0) (2023-11-22) | ||
### Bug Fixes | ||
### Features | ||
* return payload in async on Send Hook ([16471de](https://github.com/Blynskyniki/fastify-graylog-reporter/commit/16471de3c3e76dae93577c29a272b872be6e0161)) | ||
* async send, and logging errors ([e0785ac](https://github.com/Blynskyniki/fastify-graylog-reporter/commit/e0785acfe43125bee13e7090e0c964342792788d)) |
import { GelfMessageSerializer } from './gelfMessageSerializer'; | ||
import { TransportAbstract } from './Transport/TransportAbstract'; | ||
type LoggerLike = { | ||
debug: (...args: any[]) => void; | ||
error: (...args: any[]) => void; | ||
}; | ||
export type ConnectionOptions = { | ||
@@ -9,2 +13,3 @@ facility: string; | ||
logs?: boolean; | ||
Logger?: LoggerLike; | ||
compress: boolean; | ||
@@ -34,1 +39,2 @@ minCompressSize: number; | ||
} | ||
export {}; |
@@ -11,2 +11,3 @@ "use strict"; | ||
const instance = new Gelf_1.GrayLogGelfReporter(options); | ||
const { Logger } = options; | ||
fastify.addHook('onSend', async (request, reply, payload) => { | ||
@@ -37,3 +38,6 @@ var _a, _b; | ||
} | ||
await instance.report(data); | ||
instance.report(data).catch(e => { | ||
Logger === null || Logger === void 0 ? void 0 : Logger.error('fastifyGrayLogReporter', e); | ||
Logger === null || Logger === void 0 ? void 0 : Logger.debug('fastifyGrayLogReporter', e.stack); | ||
}); | ||
} | ||
@@ -44,5 +48,3 @@ catch (err) { | ||
} | ||
finally { | ||
return payload; | ||
} | ||
return payload; | ||
}); | ||
@@ -49,0 +51,0 @@ done(); |
{ | ||
"name": "fastify-graylog-reporter", | ||
"version": "1.13.1", | ||
"version": "1.14.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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
146378
324