From: Mark P. <ma...@ml...> - 2003-12-23 23:26:15
|
On Dec 15, Mike Schilli's good news was: >=20 > King, James X -ND wrote on 12/15/2003, 11:50 AM: >=20 > > I=E2=80=99m looking into using the Log::Dispatch to do file rollover o= n UNIX. > > I see that it supports file rollover into backup file(s) based on > > MaxFileSize; daily, weekly or monthly log files based on a DatePattern > > or defaults. I read your Readme file: >=20 > I would suspect that Mark's rotator might get into trouble if several > instances of the rolling logfile appender are doing their thing :). > Mark, do you support (or plan on supporting) synchronization techniques? > James could certainly use l4p's Synchronized composite appender to > synchronize all output, but that's probably more than is really needed > here. Is there a way to just synchronize the rollover process from > within the rolling logfile appender? >=20 Sorry for the slow response. I think it handles synchonised rollovers from memory. Just let me take a look... If you have multiple writers that were started at different times you will find each writer will try to rotate the log file at a recurrence calculated from its start time. To sync all the writers just use a config file and update it after starting your last writer. This will cause Log::Dispatch::FileRotate->new() to be called by each of the writers close to the same time, and if your recurrences aren't too close together all should sync up just nicely. We handle multiple writers using flock(). If you open up FileRotate.pm and search for: =09Dan Waldheim you'll see some coments regarding locking/forks and the like. This may shed more light on what the code provides. Hope that helps a little. BTW, I am off the air until 12/1/04 (that's the 12th of Jan). cheers markpf *** Merry whatever takes your fancy *** Perception is reality - now you percieve me, now you don't ---------------------------------------------------------------------------= - Mark Pfeiffer |Email : Mar...@ml... Computer Systems Engineer |Snail : PO Box 334, Oatley, NSW, 2223, Austra= lia MLP Consulting Pty. Ltd |Phone : 0417 447 538 ---------------------------------------------------------------------------= - |