koatty_exception
Advanced tools
Comparing version 1.3.2-4 to 1.3.2-5
@@ -5,2 +5,9 @@ # Changelog | ||
### [1.3.2-5](https://github.com/koatty/koatty_exception/compare/v1.3.2-4...v1.3.2-5) (2024-01-24) | ||
### Bug Fixes | ||
* span log ([9685a87](https://github.com/koatty/koatty_exception/commit/9685a87aad9343ae353a7d6034a03efad00385bd)) | ||
### [1.3.2-4](https://github.com/koatty/koatty_exception/compare/v1.3.2-3...v1.3.2-4) (2024-01-24) | ||
@@ -7,0 +14,0 @@ |
/*! | ||
* @Author: richen | ||
* @Date: 2024-01-24 11:31:04 | ||
* @Date: 2024-01-24 15:16:33 | ||
* @License: BSD (3-Clause) | ||
@@ -5,0 +5,0 @@ * @Copyright (c) - <richenlin(at)gmail.com> |
/*! | ||
* @Author: richen | ||
* @Date: 2024-01-24 11:30:54 | ||
* @Date: 2024-01-24 15:16:23 | ||
* @License: BSD (3-Clause) | ||
@@ -626,8 +626,14 @@ * @Copyright (c) - <richenlin(at)gmail.com> | ||
const now = Date.now(); | ||
let message = `{"startTime":"${ctx.startTime}","duration":"${(now - ctx.startTime) || 0}","requestId":"${ctx.requestId}","endTime":"${now}","path":"${ctx.originalPath || '/'}","message":"${this.message}"`; | ||
const message = { | ||
"startTime": ctx.startTime, | ||
"duration": (now - ctx.startTime) || 0, | ||
"requestId": ctx.requestId, | ||
"endTime": now, | ||
"path": ctx.originalPath || '/', | ||
"message": this.message, | ||
}; | ||
// LOG | ||
if (this.stack) { | ||
message = `${message},stack:"${this.stack}"`; | ||
message['stack'] = this.stack; | ||
} | ||
message = `${message}}`; | ||
koatty_logger.DefaultLogger.Error(message); | ||
@@ -640,3 +646,3 @@ // span | ||
this.span.setTag(opentracing.Tags.HTTP_URL, ctx.url); | ||
this.span.log({ "error": `{"requestId": "${ctx.requestId}", "message": ${this.message}, "stack": ${this.stack} }` }); | ||
this.span.log(message); | ||
} | ||
@@ -643,0 +649,0 @@ return; |
{ | ||
"name": "koatty_exception", | ||
"version": "1.3.2-4", | ||
"version": "1.3.2-5", | ||
"description": "Exception handler for koatty.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
{ | ||
"name": "koatty_exception", | ||
"version": "1.3.2-4", | ||
"version": "1.3.2-5", | ||
"description": "Exception handler for koatty.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
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
98317
1981