Skip to content

Commit c64a1dd

Browse files
committed
test: fixed
1 parent a76ef0f commit c64a1dd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/collector/src/agent/loggerToAgentStream.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ module.exports = {
3333
stack = record.err.stack;
3434
}
3535

36-
downstreamConnection.sendLogToAgent(logLevel, message, stack);
36+
// CASE: It could be that the preinit functionality calls the logger before the agent connection is properly set up.
37+
if (downstreamConnection) {
38+
downstreamConnection.sendLogToAgent(logLevel, message, stack);
39+
}
3740
},
3841

3942
/**

0 commit comments

Comments
 (0)