From ad624172a612b1e7941055032574916148dcb5e7 Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 4 Dec 2024 01:39:35 +0000 Subject: [PATCH] Logging level changes based on environment --- services/logging.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/services/logging.js b/services/logging.js index c01951d..5aceee1 100644 --- a/services/logging.js +++ b/services/logging.js @@ -1,4 +1,12 @@ const pino = require("pino"); const logger = pino(pino.destination({ dest: 'logs/.log', sync: false })); +const environment = process.env.NODE_ENV || 'development'; +console.log(process.env.NODE_ENV); +if (environment == "production") { + logger.level = 30 +} else { + logger.level = 20 +} + module.exports = logger; \ No newline at end of file