Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] with CFileLogRoute->processLogs #3642

Closed
sizeg opened this issue Nov 21, 2014 · 1 comment
Closed

[Bug] with CFileLogRoute->processLogs #3642

sizeg opened this issue Nov 21, 2014 · 1 comment

Comments

@sizeg
Copy link

sizeg commented Nov 21, 2014

Method rotateFiles called in processLogs didn't work for me under Windows 8. After debuging I've found that function rename() hasn't permission, inspite of user administration access.

There two ways to solve problem:

  1. Turn on rotateByCopy attribute in config.
  2. Close log file handle. http://php.net/manual/ru/function.rename.php#68704
$fp=@fopen($logFile,'a');
@flock($fp,LOCK_EX);
if(@filesize($logFile)>$this->getMaxFileSize()*1024)
{
    // Here before this method need to close @fclose($fp);
    $this->rotateFiles();
@cebe
Copy link
Member

cebe commented Nov 21, 2014

we can not close the handle because we need the LOCK. you have to use rotateByCopy on systems with such constraints.

@cebe cebe closed this as completed Nov 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants