text: import winston from 'winston';
  import 'express-async-errors';
  
  export default () => {
    winston.createLogger({
      level: 'info',
      format: winston.format.json(),
      defaultMeta: { service: 'user-service' },
      transports: [
        new winston.transports.File({ filename: 'logs/error.log', level: 'error' }),
        new winston.transports.File({ filename: 'logs/combined.log' }),
      ],
      exceptionHandlers: [
        new winston.transports.File({ filename: 'logs/exceptions.log' }),
      ],
    });
  
    if (process.env.NODE_ENV !== 'production') {
      winston.add(new winston.transports.Console({
        format: winston.format.simple(),
      }));
    }
  };
  