apollo/services/logging.js

12 lines
311 B
JavaScript
Raw Normal View History

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;