Skip to content

Commit fc38fe1

Browse files
committed
feat: add LOG_LEVEL to /api/config response
- Defaults to 4 (errors only) in prod - Defaults to 0 (all logs) in dev/test - Controllable via LOG_LEVEL env var
1 parent 0fd42de commit fc38fe1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

api/controllers/config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ exports.publicGetConfig = async function (args, res) {
77
debugMode: process.env.DEBUG_MODE === 'true',
88
ENVIRONMENT: process.env.ENVIRONMENT,
99
BANNER_COLOUR: process.env.BANNER_COLOUR,
10+
// Logging: 0=All, 1=Debug, 2=Info, 3=Warn, 4=Error (default to Error in prod)
11+
LOG_LEVEL: parseInt(process.env.LOG_LEVEL, 10) || (process.env.ENVIRONMENT === 'prod' ? 4 : 0),
1012
API_LOCATION: process.env.API_LOCATION,
1113
API_PATH: process.env.API_PATH,
1214
API_PUBLIC_PATH: process.env.API_PUBLIC_PATH,

0 commit comments

Comments
 (0)