vona-core 5.1.33 → 5.1.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -2800,9 +2800,18 @@ const formatLoggerErrors = opts => {
|
|
|
2800
2800
|
};
|
|
2801
2801
|
const formatLoggerCtx = Winston.format((info, _opts) => {
|
|
2802
2802
|
const app = useApp();
|
|
2803
|
-
if (!app.ctx
|
|
2804
|
-
info.method = app.ctx.method;
|
|
2805
|
-
info.path = app.ctx.path;
|
|
2803
|
+
if (!app.ctx) return info;
|
|
2804
|
+
if (app.ctx.method) info.method = app.ctx.method;
|
|
2805
|
+
if (app.ctx.path) info.path = app.ctx.path;
|
|
2806
|
+
const telemetry = app.ctx.state.telemetry;
|
|
2807
|
+
if (telemetry?.requestId) info.request_id = telemetry.requestId;
|
|
2808
|
+
const span = telemetry?.span ?? telemetry?.serverSpan;
|
|
2809
|
+
const spanContext = span?.spanContext();
|
|
2810
|
+
if (spanContext?.traceId && spanContext?.spanId) {
|
|
2811
|
+
info.trace_id = spanContext.traceId;
|
|
2812
|
+
info.span_id = spanContext.spanId;
|
|
2813
|
+
info.trace_flags = spanContext.traceFlags;
|
|
2814
|
+
}
|
|
2806
2815
|
return info;
|
|
2807
2816
|
});
|
|
2808
2817
|
const formatLoggerDummy = Winston.format(info => {
|
|
@@ -3289,7 +3298,7 @@ async function _closeInner() {
|
|
|
3289
3298
|
process.exit(err ? 1 : 0);
|
|
3290
3299
|
}
|
|
3291
3300
|
function handleProcessWork() {
|
|
3292
|
-
['SIGINT', 'SIGUSR2'].forEach(signal => {
|
|
3301
|
+
['SIGINT', 'SIGTERM', 'SIGUSR2'].forEach(signal => {
|
|
3293
3302
|
process.on(signal, async () => {
|
|
3294
3303
|
if (__closing) return;
|
|
3295
3304
|
__closing = true;
|