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 a7d183a commit 0381836Copy full SHA for 0381836
packages/ws-server/src/webSocketServer.ts
@@ -33,12 +33,16 @@ const mainLogger = pino({
33
// https://github.com/pinojs/pino/blob/main/docs/api.md#mixin-function
34
mixin: () => {
35
const store = context.getStore();
36
- return store
37
- ? {
38
- connectionId: `[Connection ID: ${store.connectionId}] `,
39
- requestId: `[Request ID: ${store.requestId}] `,
40
- }
41
- : {};
+ if (store) {
+ // generate a new uuid for each request within a single connection
+ store.requestId = uuid();
+
+ return {
+ connectionId: `[Connection ID: ${store.connectionId}] `,
42
+ requestId: `[Request ID: ${store.requestId}] `,
43
+ };
44
+ }
45
+ return {};
46
},
47
transport: {
48
target: 'pino-pretty',
0 commit comments