0

I am using log4js to log in my node js application. I have configured logger to create a log file when the file size reaches certain max size. The logger creates a file with same filename and '.' and index number is appended to the file name where index number is incremented every time a new file is created.

I use current timestamp when file is created in the filename as: 20150730060112.log then next files created are as 20150730060112.log.1, 20150730060112.log.2 20150730060112.log.3 and so on...

I want a next file to be created with current timestamp. For e.g. if 20150730060112.log file reaches maxLogSize at lets say on 2015-07-31at 07:04:13 then the filename of new file I want to be as 20150731070413.log.

Please let me know if this is possible or any work around to get to this.

michelem
  • 14,430
  • 5
  • 50
  • 66
Viddesh
  • 441
  • 5
  • 18

0 Answers0