[
https://issues.apache.org/jira/browse/LOG4PHP-196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13474872#comment-13474872
]
Ivan Habunek commented on LOG4PHP-196:
--------------------------------------
I tried logging over an UNC path to a shared folder on my local machine
(something like "\\mymachine\share\logs\rolling.log") and it just doesn't work.
All the rolled over files are empty, except for a bunch of \0 symbols.
{code}
d:\share\logs>dir
Volume in drive D is Storage
Volume Serial Number is 689C-3320
Directory of d:\share\logs
12.10.2012 09:56 <DIR> .
12.10.2012 09:56 <DIR> ..
12.10.2012 09:56 30.043 rolling.log
12.10.2012 09:56 8.192 rolling.log.1
12.10.2012 09:56 8.192 rolling.log.2
12.10.2012 09:56 8.192 rolling.log.3
12.10.2012 09:55 8.192 rolling.log.4
12.10.2012 09:55 8.192 rolling.log.5
12.10.2012 09:55 8.192 rolling.log.6
7 File(s) 79.195 bytes
2 Dir(s) 25.227.177.984 bytes free
{code}
The rollover was set to 100KB. So the locking apparently does not work as well
over SMB.
The interesting thing is that the exact same thing happens if I use your
LoggerAppenderRollingFileWindows.
> 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