vona-core 5.1.33 → 5.1.34
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 => {
|