fix(api-gateway): add extra meta to logs

This commit is contained in:
Karol Sójko
2023-12-08 16:55:18 +01:00
parent 48e52ac48c
commit a341e78909
2 changed files with 6 additions and 0 deletions

View File

@@ -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)}`)

View File

@@ -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)}`)