This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Because java.io.File.renameTo() fails on Win32 if the destination already exists, the log file rotation as implemented in core.startup/org.netbeans.core.startup.TopLogging does not work as intended. See the following JRE related Bug Database entries for further details: <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4017593> <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4167147> After the 3rd application startup, messages.1.log and messages.2.log will never be touched again. Also, the contents of the recent messages.log file are lost on every application startup because the rotation fails silently and the FileOutputStream is created with the append argument set to false. The attached patch solves the problem by explicitly deleting messages.2.log in TopLogging.defaultHandler() before renaming the remaining files. Actually found in 6.0, but affecting all versions found in the Mercurial repository up to current.
Created attachment 63920 [details] Solution Patch
increasing priority and reassigning to Jesse for evaluation (Yarda is on vacations)
Applied as core-main #1cfcb19aa665. Thanks!
Integrated into 'main-golden', available in NB_Trunk_Production #310 build Changeset: http://hg.netbeans.org/main/rev/1cfcb19aa665 User: Jesse Glick <jglick@netbeans.org> Log: #138998: log rotation broken on Win32.