Closed jinwyp closed 1 month ago
Thanks for reporting! Currently it's not possible to customize the file name in that way. Would you like to send a Pull Request to address this issue? Remember to add unit tests.
@mcollina May I help you on this?
@subahanumanth go ahead and do it!
@mcollina This problem can be solved by adding a dateFormat option, which accepts a format string such as:
If the dateFormat option is provided, we can append the current date in the specified format to the end of the file name. For example: error-2024-09-24.log.1. However this will not be applicable for custom frequency.
I believe this approach should work well. Any other suggestions are welcome!
When set options to frequency: 'daily' The log filename is error.log.1 error.log.2
How to set log filename like error-yyyy-MM-dd.log? ex error-20240623.log
Is it possible to customize filename like log4js ?
"pattern" : "-yyyy-MM-dd.log",