Yii Framework Forum: How To Disable Yii's Log Rotation? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How To Disable Yii's Log Rotation?

#1 User is offline   phunehehe 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 09-June 11

Posted 23 July 2013 - 06:36 AM

I want to use logrotate instead of Yii's log rotation because logrotate provides more configuration options (among which compression is the most important). However, I can't find a way to stop Yii from rotating its own log file.

Looking at CFileLogRoute I found that I can work around this by making maxFileSize ridiculously high (10GB or so), and Yii won't rotate the log anymore. Is there a more elegant solution?
0

#2 User is offline   Tsunami 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 150
  • Joined: 16-February 12

Posted 23 July 2013 - 06:48 AM

What about setting maxLogFiles to 1? Not sure if the name is misleading though, from the code it looks like it keeps 2 files when you set it to 1.
0

#3 User is offline   phunehehe 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 09-June 11

Posted 25 July 2013 - 02:09 AM

View PostTsunami, on 23 July 2013 - 06:48 AM, said:

What about setting maxLogFiles to 1? Not sure if the name is misleading though, from the code it looks like it keeps 2 files when you set it to 1.


You are right, maxLogFiles defines the number of old files to keep. The default is 5, so I have one log file plus 5 old rotations.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users