debug should not be the default log level.

pull/3743/head
Mike Kao 5 months ago
parent a7d9fac7db
commit 2c7b027874

@ -45,12 +45,10 @@ const handle = app.getRequestHandler();
const logMiddleware = (req: Request, res: Response, next: NextFunction) => {
// Log information about the incoming request
console.log(`Request Method: ${req.method}`);
console.log(`Request URL: ${req.url}`);
console.log(`Request Headers: ${JSON.stringify(req.headers)}`);
console.log(`Request Body: ${JSON.stringify(req.body)}`);
// Continue processing the request
logger.debug(`Request Method: ${req.method}`);
logger.debug(`Request URL: ${req.url}`);
logger.debug(`Request Headers: ${JSON.stringify(req.headers)}`);
logger.debug(`Request Body: ${JSON.stringify(req.body)}`);
next();
};

@ -26,7 +26,7 @@ const hformat = winston.format.printf(
);
const logger = winston.createLogger({
level: process.env.LOG_LEVEL?.toLowerCase() || 'debug',
level: process.env.LOG_LEVEL?.toLowerCase() || 'info',
format: winston.format.combine(
winston.format.splat(),
winston.format.timestamp(),

Loading…
Cancel
Save