[
https://issues.apache.org/jira/browse/LOG4PHP-196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13474420#comment-13474420
]
Ivan Habunek commented on LOG4PHP-196:
--------------------------------------
Hi guys. I appreciate your contribution! It may take a little while for me to
get around to reviewing the code. We're just now pushing out version 2.3.0.
Just as a matter of curiosity, have you tried out the latest code from trunk?
There have been some substantial improvements in the way rollover is performed.
Notably, the files are locked using flock() while writing and rollover are
performed. This should, I think, prevent problems such as the ones you mention.
However, I have not tested scenarios such as yours so I'm not sure it works. :)
You can see the latest code here:
https://github.com/apache/log4php/blob/trunk/src/main/php/appenders/LoggerAppenderRollingFile.php
> Appender Rolling File: Seperate PHP processes attempting to roll the same log
> file will truncate the log.
> ---------------------------------------------------------------------------------------------------------
>
> Key: LOG4PHP-196
> URL: https://issues.apache.org/jira/browse/LOG4PHP-196
> Project: Log4php
> Issue Type: Bug
> Components: Code
> Affects Versions: 2.2.1
> Environment: Windows
> Reporter: Kyle Wiering
> Labels: bug, fix, patch
> Fix For: 2.3.0
>
> Attachments: config_roll_windows.xml, fileroller.php, filewriter.php,
> LoggerAppenderRollingFileWindows.php,
> LoggerAppenderRollingFileWindowsTest.php, LoggerAutoloader.php
>
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> Attaching a class extension to LoggerAppenderRollingFile named
> LoggerAppenderRollingFileWindows. This class enacts 'blocking' to keep
> seperate PHP processes from truncating the log file by attempting to roll the
> logs at/near the same exact time. It also uses a 'rename' in a manner that
> is much quicker then a copy for large files.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira