We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 70d66e7 commit 4cc210aCopy full SHA for 4cc210a
src/telemetry/requestLogger.ts
@@ -65,16 +65,16 @@ function finishLog<SLocals extends AnyServiceLocals = ServiceLocals<Configuratio
65
return;
66
}
67
68
- const prefs = (res.locals as WithLogPrefs)[LOG_PREFS];
69
- if (prefs?.logged) {
+ const prefs = (res.locals as WithLogPrefs)[LOG_PREFS] || {};
+ if (prefs.logged) {
70
// This happens when error handler runs, but onEnd hasn't fired yet. We only log the first one.
71
72
73
74
const { logger, service } = app.locals;
75
76
let dur = 0;
77
- if (prefs?.start) {
+ if (prefs.start) {
78
const hrdur = process.hrtime(prefs.start);
79
dur = hrdur[0] + hrdur[1] / 1000000000;
80
0 commit comments