diff --git a/lib/logger/__snapshots__/err-serializer.spec.ts.snap b/lib/logger/__snapshots__/err-serializer.spec.ts.snap index 57913961ec95722454056cd1766e3eeab18af0fe..99b318b08bb5ef90baf8d4a42cc684a077ecfc81 100644 --- a/lib/logger/__snapshots__/err-serializer.spec.ts.snap +++ b/lib/logger/__snapshots__/err-serializer.spec.ts.snap @@ -59,6 +59,7 @@ Object { "headers": Object { "content-type": "application/json", }, + "httpVersion": null, "statusCode": 412, "statusMessage": "Precondition Failed", }, diff --git a/lib/logger/err-serializer.ts b/lib/logger/err-serializer.ts index 74056f72aeb570915ec95bbf210542fa0f914ded..9aa9dc30a815d5c10d1129fe44332aa246ee1524 100644 --- a/lib/logger/err-serializer.ts +++ b/lib/logger/err-serializer.ts @@ -37,6 +37,7 @@ export default function errSerializer(err: Error): any { statusMessage: err.response?.statusMessage, body: clone(err.response.body), headers: clone(err.response.headers), + httpVersion: err.response.httpVersion, }; } } diff --git a/lib/util/http/index.ts b/lib/util/http/index.ts index a9d8a68a8ad162d8f6e8858499a87831eed9ec1c..8cb1e3af52052ceb1eeea1de64dc0dc6e215ee6a 100644 --- a/lib/util/http/index.ts +++ b/lib/util/http/index.ts @@ -2,6 +2,7 @@ import crypto from 'crypto'; import URL from 'url'; import got, { Options, Response } from 'got'; import { HOST_DISABLED } from '../../constants/error-messages'; +import { logger } from '../../logger'; import { ExternalHostError } from '../../types/errors/external-host-error'; import * as memCache from '../cache/memory'; import { clone } from '../clone'; @@ -71,6 +72,7 @@ async function gotRoutine<T>( startTime: number ): Promise<Response<T>> { const requestTime = Date.now(); + logger.trace({ url, options }, 'got request'); const resp = await got<T>(url, options); const responseTime = Date.now(); const httpRequests = memCache.get('http-requests') || [];