Mantis - Resin
Viewing Issue Advanced Details
953 minor always 02-20-06 11:48 03-31-06 16:26
ferg  
 
urgent  
closed  
fixed  
none    
none 3.0.19  
0000953: access.log rollover bug
(rep by Olaf Jentsch)

We have used Resin-pro-3.0.15 for months an the rollover of access.log
took place every midnight receiving the first request at the new day.

We are using this option: rollover-period="1D"

But with Resin-pro-3.0.17 we have the same problem as with 3.0.8.
The rollover takes place but instead of starting with a new empty file it
contains all the entries from the old day and adds the new ones so
constantly increasing the file size.

I think it is the old bug from 3.0.8, which was definitely fixed in
3.0.14, but maybe the fix was introduced in an earlier version, that we
did'nt use.


Notes
(0000943)
ferg   
03-24-06 09:24   
My hack to check the log file name bugged me, so I've changed the workaround to the com.caucho.vfs.AbstractRolloverLog class. It's still a hack since the real fix would be closing the file handle, which I haven't been able to find without a complete audit of the log file instances.
 
The hack is in the movePathToArchive method. Similar to the previous one: empty access log file content if can't delete.
    boolean removed = path.remove();
    if (!removed && this instanceof AccessLogWriter && path instanceof FilePath
        && ((FilePath)path).getFile().exists()) {
        // open file in non-append mode and close it
        new FileOutputStream(((FilePath)path).getFile(), false).close();
    }
My concern is that a hack at the vfs level could break something in Resin that I'm not aware of. So far it seems to be working.