Skip to content

Commit

Permalink
fix(api-gateway): add extra meta to logs
Browse files Browse the repository at this point in the history
  • Loading branch information
karolsojko committed Dec 8, 2023
1 parent 48e52ac commit a341e78
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/api-gateway/src/Service/Http/HttpServiceProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ export class HttpServiceProxy implements ServiceProxyInterface {
tooManyRetryAttempts
? `Request to ${serverUrl}/${endpoint} timed out after ${retryAttempt} retries`
: `Could not pass the request to ${serverUrl}/${endpoint} on underlying service: ${detailedErrorMessage}`,
{
userId: response.locals.user ? response.locals.user.uuid : undefined,
},
)

this.logger.debug(`Response error: ${JSON.stringify(error)}`)
Expand Down
3 changes: 3 additions & 0 deletions packages/api-gateway/src/Service/gRPC/GRPCServiceProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,9 @@ export class GRPCServiceProxy implements ServiceProxyInterface {
tooManyRetryAttempts
? `Request to ${serverUrl}/${endpoint} timed out after ${retryAttempt} retries`
: `Could not pass the request to ${serverUrl}/${endpoint} on underlying service: ${detailedErrorMessage}`,
{
userId: response.locals.user ? response.locals.user.uuid : undefined,
},
)

this.logger.debug(`Response error: ${JSON.stringify(error)}`)
Expand Down

0 comments on commit a341e78

Please sign in to comment.