Baphomet is the dedicated bot for nulloctet matrix
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
595 B

  1. let winston = require('winston');
  2. let logger = winston.createLogger({
  3. level: 'info',
  4. format: winston.format.json(),
  5. defaultMeta: { service: 'user-service' },
  6. transports: [
  7. new winston.transports.File({ filename: 'error.log', level: 'error' }),
  8. new winston.transports.File({ filename: 'combined.log' })
  9. ]
  10. });
  11. if (process.env.NODE_ENV !== 'production') {
  12. logger.add(new winston.transports.Console({
  13. format: winston.format.simple()
  14. }));
  15. }
  16. if (process.env.LOG_LEVEL !== '') {
  17. logger.level = process.env.LOG_LEVEL
  18. }
  19. exports.logger = logger;