Skip to content

Commit

Permalink
SIR-1075 Updating logging
Browse files Browse the repository at this point in the history
  • Loading branch information
teddmason committed Oct 16, 2024
1 parent c39b0b3 commit bd1c49e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"cron-parser": "^4.9.0",
"css-loader": "^7.1.2",
"govuk-frontend": "^5.7.1",
"hapi-pino": "12.1.0",
"hapi-pino": "^12.1.0",
"joi": "^17.13.3",
"moment": "^2.30.1",
"node-sass": "^9.0.0",
Expand Down
20 changes: 18 additions & 2 deletions server/plugins/logging.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ export default {
plugin: HapiPino,
options: {
logPayload: true,
level: config.logLevel
level: config.logLevel,
redact: {
paths: ['req.headers.authorization', 'req.headers.cookie', 'res.headers'],
remove: true
},
ignorePaths: [
'/public/stylesheets/application.css',
'/public/js/core.js',
'/public/js/cookies.js',
'/public/js/locationMap.js',
'/public/govuk-frontend.min.js',
'/public/images/favicon.svg',
'/public/images/govuk-crest.svg',
'/public/manifest.json',
'/public/fonts/light-94a07e06a1-v2.woff2',
'/public/fonts/bold-b542beb274-v2.woff2'
]
}
}
}
2 changes: 1 addition & 1 deletion server/utils/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const schema = Joi.object().keys({
redisPort: Joi.number().default(defaultRedisPort),
redisPassword: Joi.string(),
redisTls: Joi.bool().default(false),
logLevel: Joi.string().default('warn'),
logLevel: Joi.string().default('info'),
sessionCookiePassword: Joi.string().default('the-password-must-be-at-least-32-characters-long'),
authCookiePassword: Joi.string().default('the-password-must-be-at-least-32-characters-long'),
cookieIsSecure: Joi.bool().default(false),
Expand Down

0 comments on commit bd1c49e

Please sign in to comment.