From: Xavier Date: 2004-05-10T19:24:01+09:00 Subject: Re: logger.rb does not rotate files properly [solved] On Mon, 10 May 2004 19:01:02 +0900, NAKAMURA, Hiroshi wrote: > Hi, > > Xavier wrote: >> I thought I'd mention that logger.rb does not rotate log files after it >> has already rotated once. It does not set the sync flag to true when it >> creates a new log file which means the stat.size call will always return 0 >> after the first rotation. > > I don't remember your first mail you mention here. Maybe I slipped a > message to ruby-bugs ML. And I'm very sorry for long silence. What first email? That was my first post about this issue. > I still don't understand the problem (weekly shifting seems to work for > me...), but I think anyway IO#sync = true is a must as you said. I'll > commit your path tonight. > I've noticed it's been included a few days ago: http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/ruby/lib/logger.rb.diff?r1=1.5.2.2;r2=1.5.2.3;f=h Weekly rotations work because they do not need log file size. Problem is rotation was done only once when based on size. Simply set a small file size and start logging. The second log file, i.e. the first one created by LogDevice::create_logfile did not have its sync flag raised and would not be rotated because stat would return a 0-size. In other words, you never got a 3rd log file. > Thank you for your patch and again apologize for not responding long > time. No problem. I'm happy to see it's been solved. Regards.