From 9fe05115a0550086d87d0b5cde7d74bad952343b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 27 Jul 2023 08:47:36 +0100 Subject: [PATCH 1/4] chore(deps-dev): Bump @types/node from 20.4.4 to 20.4.5 (#356) Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.4.4 to 20.4.5.
Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@types/node&package-manager=npm_and_yarn&previous-version=20.4.4&new-version=20.4.5)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 44 ++++++++++++++++++++++---------------------- package.json | 2 +- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index a0da7f30..882ece83 100644 --- a/package-lock.json +++ b/package-lock.json @@ -52,7 +52,7 @@ "@types/express": "^4.17.17", "@types/jest": "^29.5.3", "@types/lodash": "^4.14.195", - "@types/node": "^20.4.4", + "@types/node": "^20.4.5", "@types/supertest": "^2.0.12", "@typescript-eslint/eslint-plugin": "^6.2.0", "@typescript-eslint/parser": "^6.2.0", @@ -1779,7 +1779,7 @@ "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", - "dev": true, + "devOptional": true, "dependencies": { "@jridgewell/trace-mapping": "0.3.9" }, @@ -1791,7 +1791,7 @@ "version": "0.3.9", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", - "dev": true, + "devOptional": true, "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -2408,7 +2408,7 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", - "dev": true, + "devOptional": true, "engines": { "node": ">=6.0.0" } @@ -2436,7 +2436,7 @@ "version": "1.4.15", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true + "devOptional": true }, "node_modules/@jridgewell/trace-mapping": { "version": "0.3.18", @@ -3016,25 +3016,25 @@ "version": "1.0.9", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", "integrity": "sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==", - "dev": true + "devOptional": true }, "node_modules/@tsconfig/node12": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", - "dev": true + "devOptional": true }, "node_modules/@tsconfig/node14": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", - "dev": true + "devOptional": true }, "node_modules/@tsconfig/node16": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", - "dev": true + "devOptional": true }, "node_modules/@tsconfig/node20": { "version": "20.1.0", @@ -3253,10 +3253,10 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.4.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.4.tgz", - "integrity": "sha512-CukZhumInROvLq3+b5gLev+vgpsIqC2D0deQr/yS1WnxvmYLlJXZpaQrQiseMY+6xusl79E04UjWoqyr+t1/Ew==", - "dev": true + "version": "20.4.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.5.tgz", + "integrity": "sha512-rt40Nk13II9JwQBdeYqmbn2Q6IVTA5uPhvSO+JVqdXw/6/4glI6oR9ezty/A9Hg5u7JH4OmYmuQ+XvjKm0Datg==", + "devOptional": true }, "node_modules/@types/normalize-package-data": { "version": "2.4.1", @@ -3834,7 +3834,7 @@ "version": "8.10.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", - "dev": true, + "devOptional": true, "bin": { "acorn": "bin/acorn" }, @@ -3864,7 +3864,7 @@ "version": "8.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", - "dev": true, + "devOptional": true, "engines": { "node": ">=0.4.0" } @@ -4058,7 +4058,7 @@ "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true + "devOptional": true }, "node_modules/argparse": { "version": "2.0.1", @@ -5427,7 +5427,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true + "devOptional": true }, "node_modules/cross-spawn": { "version": "7.0.3", @@ -5992,7 +5992,7 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true, + "devOptional": true, "engines": { "node": ">=0.3.1" } @@ -10929,7 +10929,7 @@ "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true + "devOptional": true }, "node_modules/makeerror": { "version": "1.0.12", @@ -14207,7 +14207,7 @@ "version": "10.9.1", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", - "dev": true, + "devOptional": true, "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -14777,7 +14777,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true + "devOptional": true }, "node_modules/v8-to-istanbul": { "version": "9.1.0", @@ -15208,7 +15208,7 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true, + "devOptional": true, "engines": { "node": ">=6" } diff --git a/package.json b/package.json index a97c4936..d8d8ffa2 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "@types/express": "^4.17.17", "@types/jest": "^29.5.3", "@types/lodash": "^4.14.195", - "@types/node": "^20.4.4", + "@types/node": "^20.4.5", "@types/supertest": "^2.0.12", "@typescript-eslint/eslint-plugin": "^6.2.0", "@typescript-eslint/parser": "^6.2.0", From e3ecc57ff56e771db322abd791e4ef7037575ae9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 27 Jul 2023 08:49:53 +0100 Subject: [PATCH 2/4] chore(deps-dev): Bump @types/lodash from 4.14.195 to 4.14.196 (#355) Bumps [@types/lodash](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/lodash) from 4.14.195 to 4.14.196.
Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@types/lodash&package-manager=npm_and_yarn&previous-version=4.14.195&new-version=4.14.196)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 882ece83..635c9af0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -51,7 +51,7 @@ "@types/compression": "^1.7.2", "@types/express": "^4.17.17", "@types/jest": "^29.5.3", - "@types/lodash": "^4.14.195", + "@types/lodash": "^4.14.196", "@types/node": "^20.4.5", "@types/supertest": "^2.0.12", "@typescript-eslint/eslint-plugin": "^6.2.0", @@ -3235,9 +3235,9 @@ "dev": true }, "node_modules/@types/lodash": { - "version": "4.14.195", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.195.tgz", - "integrity": "sha512-Hwx9EUgdwf2GLarOjQp5ZH8ZmblzcbTBC2wtQWNKARBSxM9ezRIAUpeDTgoQRAFB0+8CNWXVA9+MaSOzOF3nPg==", + "version": "4.14.196", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.196.tgz", + "integrity": "sha512-22y3o88f4a94mKljsZcanlNWPzO0uBsBdzLAngf2tp533LzZcQzb6+eZPJ+vCTt+bqF2XnvT9gejTLsAcJAJyQ==", "dev": true }, "node_modules/@types/mime": { diff --git a/package.json b/package.json index d8d8ffa2..ca858925 100644 --- a/package.json +++ b/package.json @@ -62,7 +62,7 @@ "@types/compression": "^1.7.2", "@types/express": "^4.17.17", "@types/jest": "^29.5.3", - "@types/lodash": "^4.14.195", + "@types/lodash": "^4.14.196", "@types/node": "^20.4.5", "@types/supertest": "^2.0.12", "@typescript-eslint/eslint-plugin": "^6.2.0", From c9e041862dc056ad655ad971925468644fbbe77b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 27 Jul 2023 08:51:22 +0100 Subject: [PATCH 3/4] chore(deps): Bump pino-pretty from 10.1.0 to 10.2.0 (#354) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps [pino-pretty](https://github.com/pinojs/pino-pretty) from 10.1.0 to 10.2.0.
Release notes

Sourced from pino-pretty's releases.

v10.2.0

What's Changed

New Contributors

Full Changelog: https://github.com/pinojs/pino-pretty/compare/v10.1.0...v10.2.0

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pino-pretty&package-manager=npm_and_yarn&previous-version=10.1.0&new-version=10.2.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 635c9af0..9f6dba3f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,7 +31,7 @@ "passport": "^0.6.0", "passport-headerapikey": "^1.2.2", "pino-http": "^8.3.3", - "pino-pretty": "^10.1.0", + "pino-pretty": "^10.2.0", "reflect-metadata": "^0.1.13", "rxjs": "^7.8.1", "tsconfig-paths": "^4.2.0", @@ -11978,9 +11978,9 @@ } }, "node_modules/pino-pretty": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/pino-pretty/-/pino-pretty-10.1.0.tgz", - "integrity": "sha512-9gAgVHCVTEq0ThcjoXkOICYQgdqh1h90WSuVAnNeCrRrefJInUvMbpDfy6PlsI29Nbu9UW9CGkUHztrR1A9N+A==", + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/pino-pretty/-/pino-pretty-10.2.0.tgz", + "integrity": "sha512-tRvpyEmGtc2D+Lr3FulIZ+R1baggQ4S3xD2Ar93KixFEDx6SEAUP3W5aYuEw1C73d6ROrNcB2IXLteW8itlwhA==", "dependencies": { "colorette": "^2.0.7", "dateformat": "^4.6.3", diff --git a/package.json b/package.json index ca858925..83c9e8b3 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "passport": "^0.6.0", "passport-headerapikey": "^1.2.2", "pino-http": "^8.3.3", - "pino-pretty": "^10.1.0", + "pino-pretty": "^10.2.0", "reflect-metadata": "^0.1.13", "rxjs": "^7.8.1", "tsconfig-paths": "^4.2.0", From fc54db25340f8ac2c5838c8c710d5946e834da36 Mon Sep 17 00:00:00 2001 From: francescastocco <73140108+francescastocco@users.noreply.github.com> Date: Thu, 27 Jul 2023 14:20:06 +0100 Subject: [PATCH 4/4] feat(apim-538): add environment variable for log format (#337) ## Introduction Currently, all our log messages use the single line format which makes them hard to read during local development but is good for the dev, staging, and production environments. ## Resolution - Added an environment variable that controls if we use single line or multi-line logging format - Use this to set the singleLine property in our logging config ## Misc - Added tests for log level --------- Co-authored-by: Alex Bramhill --- .env.sample | 1 + src/config/app.config.test.ts | 50 +++++++++++++++++++++++++++ src/config/app.config.ts | 1 + src/main.module.ts | 2 +- test/support/environment-variables.ts | 2 ++ 5 files changed, 55 insertions(+), 1 deletion(-) diff --git a/.env.sample b/.env.sample index b3f44894..830dd55e 100644 --- a/.env.sample +++ b/.env.sample @@ -3,6 +3,7 @@ PORT= LOG_LEVEL=debug REDACT_LOGS=false +SINGLE_LINE_LOG_FORMAT=true # Swagger SWAGGER_USER= diff --git a/src/config/app.config.test.ts b/src/config/app.config.test.ts index 4197317d..30993c04 100644 --- a/src/config/app.config.test.ts +++ b/src/config/app.config.test.ts @@ -129,6 +129,56 @@ describe('appConfig', () => { }); }); + describe('parsing SINGLE_LINE_LOG_FORMAT', () => { + it('sets singleLineLogFormat to true if SINGLE_LINE_LOG_FORMAT is true', () => { + replaceEnvironmentVariables({ + SINGLE_LINE_LOG_FORMAT: 'true', + }); + + const config = appConfig(); + + expect(config.singleLineLogFormat).toBe(true); + }); + + it('sets singleLineLogFormat to false if SINGLE_LINE_LOG_FORMAT is false', () => { + replaceEnvironmentVariables({ + SINGLE_LINE_LOG_FORMAT: 'false', + }); + + const config = appConfig(); + + expect(config.singleLineLogFormat).toBe(false); + }); + + it('sets singleLineLogFormat to true if SINGLE_LINE_LOG_FORMAT is not specified', () => { + replaceEnvironmentVariables({}); + + const config = appConfig(); + + expect(config.singleLineLogFormat).toBe(true); + }); + + it('sets singleLineLogFormat to true if SINGLE_LINE_LOG_FORMAT is the empty string', () => { + replaceEnvironmentVariables({ + SINGLE_LINE_LOG_FORMAT: '', + }); + + const config = appConfig(); + + expect(config.singleLineLogFormat).toBe(true); + }); + + it('sets singleLineLogFormat to true if SINGLE_LINE_LOG_FORMAT is any string other than true or false', () => { + replaceEnvironmentVariables({ + SINGLE_LINE_LOG_FORMAT: valueGenerator.string(), + }); + + const config = appConfig(); + + expect(config.singleLineLogFormat).toBe(true); + }); + }); + const replaceEnvironmentVariables = (newEnvVariables: Record): void => { process.env = newEnvVariables; }; diff --git a/src/config/app.config.ts b/src/config/app.config.ts index f38e82c5..3c1b69bc 100644 --- a/src/config/app.config.ts +++ b/src/config/app.config.ts @@ -24,5 +24,6 @@ export default registerAs('app', (): Record => { apiKey: process.env.API_KEY, logLevel: process.env.LOG_LEVEL || 'info', redactLogs: process.env.REDACT_LOGS !== 'false', + singleLineLogFormat: process.env.SINGLE_LINE_LOG_FORMAT !== 'false', }; }); diff --git a/src/main.module.ts b/src/main.module.ts index 6fb41e02..afd47d2e 100644 --- a/src/main.module.ts +++ b/src/main.module.ts @@ -29,7 +29,7 @@ import { LoggingInterceptor } from './logging/logging-interceptor.helper'; transport: { target: 'pino-pretty', options: { - singleLine: true, + singleLine: config.get('app.singleLineLogLevel'), }, }, hooks: { diff --git a/test/support/environment-variables.ts b/test/support/environment-variables.ts index cb9e3133..1c9a8d29 100644 --- a/test/support/environment-variables.ts +++ b/test/support/environment-variables.ts @@ -6,6 +6,7 @@ export const ENVIRONMENT_VARIABLES = Object.freeze({ NODE_ENV: 'test', LOG_LEVEL: 'debug', REDACT_LOGS: false, + SINGLE_LINE_LOG_FORMAT: true, SWAGGER_USER: valueGenerator.string(), SWAGGER_PASSWORD: valueGenerator.string(), @@ -22,6 +23,7 @@ export const ENVIRONMENT_VARIABLES = Object.freeze({ export const getEnvironmentVariablesForProcessEnv = (): NodeJS.ProcessEnv => ({ ...ENVIRONMENT_VARIABLES, REDACT_LOGS: ENVIRONMENT_VARIABLES.REDACT_LOGS.toString(), + SINGLE_LINE_LOG_FORMAT: ENVIRONMENT_VARIABLES.SINGLE_LINE_LOG_FORMAT.toString(), APIM_INFORMATICA_MAX_REDIRECTS: ENVIRONMENT_VARIABLES.APIM_INFORMATICA_MAX_REDIRECTS.toString(), APIM_INFORMATICA_TIMEOUT: ENVIRONMENT_VARIABLES.APIM_INFORMATICA_TIMEOUT.toString(), });