Search code examples
phploggingyiiamazon-ec2ownership

yii 1.X application log issue


i have application that is hosted on Amazon EC2 instances i log my application using Yii 1.X Logger like this

Yii::log("Something i Log Here...", "info");

aaand , as we all know , i log my files into WEBROOT/protected/runtime/application.log file. Because of many logs i use, application.log file fill so quick , and , as i see , Yii or server change that file to application.log.1 and creates a new file called application.log .

My Question is , why, when new application.log file is created , Owner and Group are like some user nobody, and , when the new file is created, my code such as logging doesn't work anymore , no good permissions for writing into file as www-data user. Are there any chances to create new application.log file as user different as NOBODY?

I will provide Image , and look closer to application.log.3 ownership, same is happening with application.log , but i've changed the permissions by command

Image: 1

Anyone Please Help me about this.


Solution

  • If you see CFileLogRoute.php class, a private variable $_maxFileSize is defined as 1024KB. when ever the size of .log file exceeds beyond this limit, this class will rotate the log files by creating new log file.

    For more explanation please refer http://www.yiiframework.com/doc/api/1.1/CFileLogRoute