From: King, J. X -N. <Jam...@di...> - 2003-12-15 19:50:37
|
I'm looking into using the Log::Dispatch to do file rollover on 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: http://www.perl.com/CPAN-local/modules/by-module/Log/MARKPF/Log-Dispatch -FileRotate-1.08.readme I'm just wondering how the file rollover syncs up when multiple CGI processes using Log4perl are running and attempting to rollover a file. I have not put in place the Log::Log4perl::Appended::Synchronized yet because it looks like we are not losing any records written to the log file. Is the Log::Log4perl::Appended::Synchronized something that should be in place for the Dispatcher::FileRotate to manage in a multiple process environment? Thanks, - James =20 =20 James C. King Software Engineer email: Jam...@di... <mailto:Jam...@di...>=20 (818) 623-3594 =20 |
From: Mike S. <msc...@ao...> - 2003-12-15 22:17:49
|
King, James X -ND wrote on 12/15/2003, 11:50 AM: > I=E2=80=99m looking into using the Log::Dispatch to do file rollover on U= NIX. > 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: 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 -- Mike Mike Schilli m...@pe... |
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 ---------------------------------------------------------------------------= - |
From: Mike S. <msc...@ao...> - 2003-12-26 19:41:33
|
Mark Pfeiffer wrote on 12/23/2003, 3:26 PM: > We handle multiple writers using flock(). Thanks for clarifying that, Mark. It seems like you're synchronizing every logged message via flock(), though (sub logit()) -- is that intended? I would guess this has a major performance impact. -- -- Mike Mike Schilli m...@pe... |
From: Mark P. <ma...@ml...> - 2004-01-11 22:18:35
|
On Dec 26, Mike Schilli's good news was: > Mark Pfeiffer wrote on 12/23/2003, 3:26 PM: > > > We handle multiple writers using flock(). > > Thanks for clarifying that, Mark. It seems like you're synchronizing > every logged message via flock(), though (sub logit()) -- is that > intended? I would guess this has a major performance impact. > Yes. I havn't done any performance testing to see if it is a major issue. Do you have some view on this? Are there better ways? cheers markpf |
From: Mike S. <msc...@ao...> - 2004-01-13 08:26:21
|
Mark Pfeiffer wrote on 1/11/2004, 2:18 PM: > Yes. I havn't done any performance testing to see if it is a major > issue. Do you have some view on this? Are there better ways? One improvement would be being able to disable it if there's just one writer thread/process or if synching is done otherwise (e.g. via a l4p Synchronized appender). -- -- Mike Mike Schilli m...@pe... |