chore(api): add log level configuration

This commit is contained in:
Shaun Hamilton
2025-01-02 18:21:55 +05:30
committed by Mrugesh Mohapatra
parent 55deb556ce
commit a477643d7d
3 changed files with 30 additions and 4 deletions
+8 -4
View File
@@ -4,7 +4,12 @@
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
/// <reference path="./reset.d.ts" />
import { build } from './app';
import { FREECODECAMP_NODE_ENV, HOST, PORT } from './utils/env';
import {
FREECODECAMP_NODE_ENV,
FCC_API_LOG_LEVEL,
HOST,
PORT
} from './utils/env';
const envToLogger = {
development: {
@@ -15,10 +20,9 @@ const envToLogger = {
ignore: 'pid,hostname'
}
},
level: 'debug'
level: FCC_API_LOG_LEVEL
},
// TODO: is this the right level for production or should we use 'error'?
production: { level: 'fatal' },
production: { level: FCC_API_LOG_LEVEL },
test: undefined
};