Skip to content

Commit 2d4e05d

Browse files
authored
Add logging for proxy requests (#1039)
* add some log * changeset
1 parent b9d7c4b commit 2d4e05d

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.changeset/rotten-buses-scream.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@gitbook/integration-gitlab': patch
3+
---
4+
5+
Add logs

integrations/gitlab/src/api.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ export async function proxyRequest(
345345
const proxyUrl = new URL(context.environment.secrets.PROXY_URL);
346346

347347
proxyUrl.searchParams.set('target', url);
348+
logger.info(`Proxying request to ${proxyUrl.toString()}, original target: ${url}`);
348349

349350
return fetch(proxyUrl.toString(), {
350351
...options,
@@ -379,7 +380,7 @@ export async function shouldUseProxy(context: GitLabRuntimeContext): Promise<boo
379380

380381
return flag.isEnabled;
381382
} catch (e) {
382-
logger.error('Error checking Reflag feature flag:', e);
383+
logger.debug('Error checking Reflag feature flag:', e);
383384
return false;
384385
}
385386
}

0 commit comments

Comments
 (0)