Skip to content

Commit

Permalink
chore(data-proxy): add logs to request child logger
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomasvdam committed Nov 27, 2024
1 parent 4e4d62c commit 47f1518
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions workspace/data-proxy/src/proxy-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export function startProxyServer(
let responseData: string = upstreamTextResponse.value;

if (route.jsonPath) {
logger.debug(`Applying route JSONpath ${route.jsonPath}`);
requestLogger.debug(`Applying route JSONpath ${route.jsonPath}`);
const data = queryJson(
upstreamTextResponse.value,
route.jsonPath,
Expand All @@ -204,7 +204,7 @@ export function startProxyServer(
}

responseData = JSON.stringify(data.value);
logger.debug("Successfully applied route JSONpath");
requestLogger.debug("Successfully applied route JSONpath");
}

const jsonPathRequestHeader = Maybe.of(
Expand All @@ -213,7 +213,7 @@ export function startProxyServer(

// TODO: Would be nice to only parse the JSON once
if (jsonPathRequestHeader.isJust) {
logger.debug(
requestLogger.debug(
`Applying request JSONpath ${jsonPathRequestHeader.value}`,
);
// We apply the JSON path to the data that's exposed by the data proxy.
Expand All @@ -229,7 +229,7 @@ export function startProxyServer(
}

responseData = JSON.stringify(data.value);
logger.debug("Successfully applied request JSONpath");
requestLogger.debug("Successfully applied request JSONpath");
}

// If the route or proxy has a public endpoint we replace the protocol and host with the public endpoint.
Expand All @@ -240,7 +240,7 @@ export function startProxyServer(
return `${t}${request.url.slice(pathIndex)}`;
});

logger.debug("Signing data", {
requestLogger.debug("Signing data", {
calledEndpoint,
method: request.method,
body: requestBody.unwrapOr(undefined),
Expand Down

0 comments on commit 47f1518

Please sign in to comment.