apollo/services/logging.js

11 lines
276 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';
if (environment == "production") {
logger.level = 30
} else {
logger.level = 20
}
module.exports = logger;