title: Nodejs winston logging port 514 folder/yyyy/mm/dd/.log
body: <p>Hi i want to log 514 udp port with nodejs winston. I want to save all log diary with same log name and different folder. Example  /listen/2019/11/04/test.log  next day /listen/2019/11/05/test.log . I try but only save 1 date and Log address does not change when date changes.</p>
  
  <pre><code>var winston = require('winston');
  var d = new Date();
  var year = d.getFullYear();
  var month = (d.getMonth() + 1) ;
  var day = d.getDate();
  var n = d.getMinutes();
  var shell = require('shelljs');
  shell.mkdir('-p', '/listen/test/'+year+'/'+month+'/'+day);
  
  var logger = winston.createLogger({
    level: 'info',
    format: winston.format.simple(),
    defaultMeta: { service: 'user-service' },
    transports: [
  
      new winston.transports.File({ filename: 'error.log', level: 'error' }),
      new winston.transports.File({ filename: '/listen/test/'+year+'/'+month+'/'+day+'/test.log' })
    ]
  });
  
  var PORT = 514;
  var HOST = '0.0.0.0';
  var dgram = require('dgram');
  var server = dgram.createSocket('udp4');
  server.bind(PORT, HOST);
  
  server.on('listening', function () {
      var address = server.address();
      console.log('UDP Server listening on ' + address.address + ":" + address.port);
  });
  
  server.on('message', function (message, remote) {
        logger.info(message);
  });
  </code></pre>