Skip to content

Commit 2ec2c5f

Browse files
feat(APIM-468): merge main branch
2 parents 1b5cfe3 + fc54db2 commit 2ec2c5f

File tree

7 files changed

+44
-34
lines changed

7 files changed

+44
-34
lines changed

.env.sample

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ PORT=
33

44
LOG_LEVEL=debug
55
REDACT_LOGS=false
6+
SINGLE_LINE_LOG_FORMAT=true
67

78
# Swagger
89
SWAGGER_USER=

package-lock.json

Lines changed: 30 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"passport": "^0.6.0",
4343
"passport-headerapikey": "^1.2.2",
4444
"pino-http": "^8.3.3",
45-
"pino-pretty": "^10.1.0",
45+
"pino-pretty": "^10.2.0",
4646
"reflect-metadata": "^0.1.13",
4747
"rxjs": "^7.8.1",
4848
"tsconfig-paths": "^4.2.0",
@@ -62,8 +62,8 @@
6262
"@types/compression": "^1.7.2",
6363
"@types/express": "^4.17.17",
6464
"@types/jest": "^29.5.3",
65-
"@types/lodash": "^4.14.195",
66-
"@types/node": "^20.4.4",
65+
"@types/lodash": "^4.14.196",
66+
"@types/node": "^20.4.5",
6767
"@types/supertest": "^2.0.12",
6868
"@typescript-eslint/eslint-plugin": "^6.2.0",
6969
"@typescript-eslint/parser": "^6.2.0",

src/config/app.config.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ describe('appConfig', () => {
8686
environmentVariableName: string;
8787
defaultConfigValue: boolean;
8888
}[] = [
89+
{
90+
configPropertyName: 'singleLineLogFormat',
91+
environmentVariableName: 'SINGLE_LINE_LOG_FORMAT',
92+
defaultConfigValue: true,
93+
},
8994
{
9095
configPropertyName: 'redactLogs',
9196
environmentVariableName: 'REDACT_LOGS',

src/config/app.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export interface AppConfig {
1818
apiKey: string;
1919
logLevel: string;
2020
redactLogs: boolean;
21+
singleLineLogFormat: boolean;
2122
}
2223

2324
export default registerAs('app', (): Record<string, any> => {
@@ -40,5 +41,6 @@ export default registerAs('app', (): Record<string, any> => {
4041
apiKey: process.env.API_KEY,
4142
logLevel: process.env.LOG_LEVEL || 'info',
4243
redactLogs: process.env.REDACT_LOGS !== 'false',
44+
singleLineLogFormat: process.env.SINGLE_LINE_LOG_FORMAT !== 'false',
4345
};
4446
});

src/main.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { LoggingInterceptor } from './logging/logging-interceptor.helper';
2929
transport: {
3030
target: 'pino-pretty',
3131
options: {
32-
singleLine: true,
32+
singleLine: config.get<boolean>('app.singleLineLogLevel'),
3333
},
3434
},
3535
hooks: {

test/support/environment-variables.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export const ENVIRONMENT_VARIABLES = Object.freeze({
66
NODE_ENV: 'test',
77
LOG_LEVEL: 'debug',
88
REDACT_LOGS: false,
9+
SINGLE_LINE_LOG_FORMAT: true,
910

1011
SWAGGER_USER: valueGenerator.string(),
1112
SWAGGER_PASSWORD: valueGenerator.string(),
@@ -22,6 +23,7 @@ export const ENVIRONMENT_VARIABLES = Object.freeze({
2223
export const getEnvironmentVariablesForProcessEnv = (): NodeJS.ProcessEnv => ({
2324
...ENVIRONMENT_VARIABLES,
2425
REDACT_LOGS: ENVIRONMENT_VARIABLES.REDACT_LOGS.toString(),
26+
SINGLE_LINE_LOG_FORMAT: ENVIRONMENT_VARIABLES.SINGLE_LINE_LOG_FORMAT.toString(),
2527
APIM_INFORMATICA_MAX_REDIRECTS: ENVIRONMENT_VARIABLES.APIM_INFORMATICA_MAX_REDIRECTS.toString(),
2628
APIM_INFORMATICA_TIMEOUT: ENVIRONMENT_VARIABLES.APIM_INFORMATICA_TIMEOUT.toString(),
2729
});

0 commit comments

Comments
 (0)