You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's a simple fix (I'm preparing a patch for it): // Get base file name - i.e. without file extension : remove everything after the last dot (up to then end of string) var base_file_name = file.replace(/\.[^\.]+$/, '') // Get file extension : replace everything by string after the last dot var file_ext = file.replace(/^.*\.([^\.]*)$/i, '$1') // Build final filename with base + time + extension var final_name = base_file_name + '__' + final_time + '.' + file_ext;
I'm using pm2-logrotate - works fine but it ignores file extension when rotating. The file name always end with .log, even for error files (stderr).
Looking at source code it seems to be easy to fix on line 107:
var final_name = file.substr(0, file.length - 4) + '__' + final_time + '.log';
Simply reuse orignal file extension instead of hard-coded '.log'
Regards,
E.
The text was updated successfully, but these errors were encountered: