text: const winston = require('winston');
  const { createLogger, format, transports } = require('winston');
  const config = require('./config');
  require('winston-daily-rotate-file');
  
  const logger = createLogger({
    level: config.logging.level,
    format: format.combine(
      format.timestamp({
        format: 'YYYY-MM-DD HH:mm:ss',
      }),
      format.printf((info) => `${info.timestamp} ${info.level}: ${info.message}`),
    ),
    transports: [
      new transports.Console({
        format: format.combine(
          format.colorize({ all: true }),
        ),
      }),
      new winston.transports.DailyRotateFile({
        filename: 'node-starter-%DATE%.log',
        dirname: 'logs',
        datePattern: 'YYYY-MM-DD',
        zippedArchive: true,
        maxSize: '500m',
        maxFiles: '7d',
      }),
    ],
  });
  
  module.exports = logger;
  