Skip to content

Commit

Permalink
Merge pull request #4354 from jdayamx/Add-log-file-permissions
Browse files Browse the repository at this point in the history
Added log file permissions
  • Loading branch information
marcovtwout authored May 6, 2021
2 parents 6e455a3 + c7d4120 commit 1d6c8c4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Version 1.1.24 under development
- Bug #4355: Fix errorhandler missing backtrace entries (georaldc, marcovtwout)
- Enh #4349: Added CHtml option to omit type attribute from <script> tag (mohamedmalki, marcovtwout)
- Enh #4351: Added CHtml option to omit CDATA wrapper from <script> and <style> contents (marcovtwout)
- Enh #4354: Allow to set log file permissions for CFileLogRoute (jdayamx)
- Chg #4344: Upgraded jQuery to 1.12.4 (marcovtwout)
- Chg #4344: Upgraded jQuery UI to 1.12.1 (marcovtwout)

Expand Down
9 changes: 8 additions & 1 deletion framework/logging/CFileLogRoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ class CFileLogRoute extends CLogRoute
* @since 1.1.14
*/
public $rotateByCopy=false;

/**
* @var integer the permission to be set for newly created log files.
* This value will be used by PHP chmod() function. No umask will be applied.
* If not set, the permission will be determined by the current environment.
*/
public $chmod;
/**
* Initializes the route.
* This method is invoked after the route is created by the route manager.
Expand Down Expand Up @@ -163,6 +168,8 @@ protected function processLogs($logs)
@flock($fp,LOCK_UN);
@fclose($fp);
}
if($this->chmod !== null)
@chmod($logFile, $this->chmod);
}

/**
Expand Down

0 comments on commit 1d6c8c4

Please sign in to comment.