Reason #782364 to love Java:
listFiles() - There is no guarantee that the name strings in the resulting array will appear in any specific order; they are not, in particular, guaranteed to appear in alphabetical order.
The AuditImpl.java file in createAuditFile() method uses baseFolder.listFiles() then cycles through them to generate a new index number. This code just lost me about 15 hours worth of log data which I’ll never get back now.
May I suggest that the sequential number is just done away with and a timestamp is used? Half of the file name is already a timestamp - just at the day level. Just make the whole thing an timestamp - YYYYMMDDHHIISS and then you’ll do away with the listFile() mess, sequence counting, lost data, and the arbitrary-seeming “999” limit.
Not sure where/how to deal with this request, but someone please have a look at this. I’m having to do some kludgy cron jobs to copy files out of the dir so they don’t get overwritten every minute.