Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
1.0.6
-
None
-
None
-
Linux
Description
Use rolling policy with archiving to gz. When system time set to past, rollover produces tmp file.
How to reproduce:
1. logging event creates log file <filename>.log
2. system time passes midnight = new day
3. logging event triggers rollover and creation of archive <filename>.log.<YYYYMMDD>
4. system time changes so now it points previous day.
5. logging event triggers rollover but fails to archive current <filename>.log since the file <filename>.log.<YYYYMMDD> already exists.
You use System.nanoTime() to make name of temporary file. Do you see any performance/security issues to use File.createTempFile? My concern is that you still should check if some file already exists.
It would be nice to have ability to create additional level of rolling <filename>.log.<YYYYMMDD>.<INDEX>. So i guess if code checks if target file exists it tries to match additional suffix to make file unique.
So far I see the code doesn't check if the archive file already exists.
TimeBasedRollingPolicy.java
Future renamedRawAndAsyncCompress(String nameOfCompressedFile, String innerEntryName)
throws RolloverFailure