stu2162583
stu2162583
> Hmm, does it work if you set `rotateByCopy` to `false`? thanks! Under Windows, same result, and when rename, there is an error. [yii\log\Dispatcher::dispatch] Unable to send log via yii\log\FileTarget:...
> What about file permissions? Are those log files writable by PHP? Permissions are Windows default permissions. These logs are written by php
> > > What about file permissions? Are those log files writable by PHP? > > > > > > Permissions are Windows default permissions. These logs are written by...
> Thank you, after testing, there are still some problems. I tested a rotateByCopy=true before, and the data in the source code was changed to: ``` if ($this->enableRotation && @filesize($this->logFile)...
> @stu2162583 you must unlock file before do something with him What is this for? Are you afraid of affecting the file handle? The operation after the lock was changed...
> @stu2162583 could you point the change in 2.0.16 that is the cause of that? https://github.com/yiisoft/yii2/pull/3563 2.0.16 https://github.com/yiisoft/yii2/blob/2.0.16/framework/log/FileTarget.php 2.0.15.1 https://github.com/yiisoft/yii2/blob/2.0.15.1/framework/log/FileTarget.php
@bizley Yes, he mentioned that the file must be renamed and then closed, but only if it is in a windows environment and rotateByCopy=false. so, what to do next
@WinterSilence Sorry, I don't know much about lock, what is the reason for doing this
> Looks like we could adjust the process based on the selected options if this is only a matter of type of rotating and the OS. It looks like this,...
> > Sorry, I don't know much about lock, what is the reason for doing this > > @stu2162583 See this note in the PHP manual on [flock()](https://www.php.net/manual/en/function.flock.php#refsect1-function.flock-notes): > >...