Skip to content

Commit d665790

Browse files
committed
servercontext logger
1 parent 5f80335 commit d665790

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

packages/web/docs/src/content/gateway/logging-and-error-handling.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ export const gatewayConfig = defineConfig({
6262
+ plugins() {
6363
return [
6464
{
65+
onRequest({ serverContext }) {
66+
- log.info('Got request...');
67+
+ serverContext.log.info('Got request...');
68+
},
69+
onParams({ context }) {
70+
- log.info('Params...');
71+
+ context.log.info('Params...');
72+
},
6573
onExecute({ context }) {
6674
- log.info('Executing...');
6775
+ context.log.info('Executing...');
@@ -78,6 +86,10 @@ export const gatewayConfig = defineConfig({
7886
- log.info('Fetching data...');
7987
+ context.log.info('Fetching data...');
8088
},
89+
onResponse({ serverContext }) {
90+
- log.info('Responding...');
91+
+ serverContext.log.info('Responding...');
92+
},
8193
},
8294
];
8395
},

packages/web/docs/src/content/migration-guides/gateway-v1-v2.mdx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,14 @@ export const gatewayConfig = defineConfig({
357357
+ plugins() {
358358
return [
359359
{
360+
onRequest({ serverContext }) {
361+
- log.info('Got request...');
362+
+ serverContext.log.info('Got request...');
363+
},
364+
onParams({ context }) {
365+
- log.info('Params...');
366+
+ context.log.info('Params...');
367+
},
360368
onExecute({ context }) {
361369
- log.info('Executing...');
362370
+ context.log.info('Executing...');
@@ -373,6 +381,10 @@ export const gatewayConfig = defineConfig({
373381
- log.info('Fetching data...');
374382
+ context.log.info('Fetching data...');
375383
},
384+
onResponse({ serverContext }) {
385+
- log.info('Responding...');
386+
+ serverContext.log.info('Responding...');
387+
},
376388
},
377389
];
378390
},

0 commit comments

Comments
 (0)