Logging level changes based on environment
This commit is contained in:
parent
cfb63f1e3e
commit
ad624172a6
@ -1,4 +1,12 @@
|
|||||||
const pino = require("pino");
|
const pino = require("pino");
|
||||||
const logger = pino(pino.destination({ dest: 'logs/.log', sync: false }));
|
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;
|
module.exports = logger;
|
Loading…
Reference in New Issue
Block a user