From: Kevin G. <ke...@go...> - 2002-11-23 23:27:38
|
Mark, thanks for fixing that, but when I run 'make test' for version 1.05 the test runs for at least 8 minutes before I get bored and kill it. Looking at the test script, you don't actually seem to be testing anything, you're just running it for a long time, all the files could be ending up in /dev/null for all the test can tell. Might I be so bold as to suggest 1) If the test really needs to run for longer than about five seconds then tell the user in advance how long the test is expected to take. Nobody's going to want to run the test if it takes 10 minutes. But what are you actually testing with all those iterations? 2) To actually test the functionality, log enough bytes so that the logfile rolls and then check the contents of "file.log" and "file.log.1". You might take a look at the test I wrote to test the interface to FileRotate, attached, and do something like that (although Mike S. says he's seen it misbehave, so it might not be the best thing to steal from). 3) You should really test the file locking, there' enought code there that it should be tested. This would involve refactoring the module so that the test script can pause a logging operation right after it locks the file and then launch another logging operation to see if it does the right thing. 4) The test script sleeps for 180 seconds, so for 3 minutes + run time. I gave up running it after about 8 minutes, so that would imply there's some horrible runtime inefficiency going on? Could you check that out? mark pfeiffer wrote: > > Oops ;-( typo! > > test.pl now uses -w. Yes, I know, a HUGE oversite! > > All fixed in Version 1.05 > > On Wed, 20 Nov 2002 10:23:30 -0800 Kevin Goess's good news was: > > Mark, I noticed your hash key is sometimes LFD and sometimes LDF, > > running with -w shows error messages like this: > > > > Use of uninitialized value in ref-to-glob cast at > > blib/lib/Log/Dispatch/FileRotate.pm line 405. > > flock() on unopened filehandle at blib/lib/Log/Dispatch/FileRotate.pm > > line 405. > > Use of uninitialized value in ref-to-glob cast at > > blib/lib/Log/Dispatch/FileRotate.pm line 417. > > > > > > mark pfeiffer wrote: > > > Just uploaded a time based one. > > > > > > M/MA/MARKPF/Log-Dispatch-FileRotate-1.04.tar.gz > > > > > > Let me know what you guys think. > > > > > > > > > On Mon, 18 Nov 2002 11:08:10 -0800 Kevin Goess's good news was: > > > > Stylin! I've added a map to the log4j syntax so it can be set up like this: > > > > > > > > log4j.appender.apndr=org.apache.log4j.RollingFileAppender > > > > log4j.appender.apndr.File=app.log > > > > log4j.appender.apndr.MaxFileSize=15_000_000 > > > > log4j.appender.apndr.MaxBackupIndex=2 > > > > log4j.appender.apndr.layout=org.apache.log4j.SimpleLayout > > > > > > > > I don't suppose you have an overwhelming urge to implement > > > > DailyRollingFileAppender while you're at it? > > > > > > > > > > > > mark pfeiffer wrote: > > > > > A new version has just been uploaded to PAUSE: > > > > > > > > > > M/MA/MARKPF/Log-Dispatch-FileRotate-1.03.tar.gz > > > > > > > > > > should handle multiple writers. > > > > > > > > > > On Mon, 18 Nov 2002 09:23:02 +1100 mark pfeiffer's good news was: > > > > > > > > > > > > Thanks for the feedback Kevin. I'll chase up your leads and do some > > > > > > proper testing... What you are saying is absolutely correct! > > > > > > > > > > > > On Fri, 15 Nov 2002 10:35:19 -0800 Kevin Goess's good news was: > > > > > > > Mark, nice job and thanks, but how are you handling multiple processes > > > > > > > writing to the same log file? If you have a web server with 20 children > > > > > > > logging to the same file, you're going to get race conditions like this: > > > > > > > > > > > > > > child1: hey, the log file is too big, time to rotate! > > > > > > > child2: hey, the log file is too big, time to rotate! > > > > > > > child1: renames current file to backup > > > > > > > child2: renames empty current file to backup, kiboshes data > > > > > > > > > > > > > > That's why the apache utilities cronolog and rotatelogs both take the > > > > > > > strategy of just writing to a different file after the cutoff, leaving > > > > > > > the old file alone. I think the log4j method works for log4j because > > > > > > > they typically only one JVM per machine and thus only one singleton logger. > > > > > > > > > > > > > > To do it the log4j way, we'd need to lock the log file before messing > > > > > > > with it. (Actually, if we're renaming it, we need to keep the lock on a > > > > > > > separate file). See the floc docs under perlfaq5 or File::Lock or maybe > > > > > > > Logfile::Rotate, which looks like it uses locks, might be useful. > > > > > > > > > > > > > > What do you think? > > > > > > > > > > > > ... snip ... > > > > > > > > > > cheers > > > > > mark > > > > > > > > > > > > -- > > > > Happy Trails . . . > > > > > > > > Kevin M. Goess > > > > (and Anne and Frank) > > > > 904 Carmel Ave. > > > > Albany, CA 94706 > > > > (510) 525-5217 > > > > > > cheers > > > mark > > > __ > > > Mark Pfeiffer <mar...@ed...> > > > Mark Pfeiffer <ma...@ml...> > > > TCNZA EMC IB | Mobile: 0414 771 245 | Phone: +61 2 9378 5024 > > > Snail: L5, 48 Martin Place, Sydney, Australia > > > > > > ---- Legal ------ > > > Important: This email message and attachments (if any) are confidential > > > and may be legally privileged. If you are not the intended recipient, > > > you must not disclose, copy or use the information contained in it > > > in any way. If you have received this email in error, please advise > > > immediately by return email and delete this email and its attachments > > > (if any). Thank you. > > > > > > -- > > Happy Trails . . . > > > > Kevin M. Goess > > (and Anne and Frank) > > 904 Carmel Ave. > > Albany, CA 94706 > > (510) 525-5217 > > cheers > mark > __ > Mark Pfeiffer <mar...@ed...> > Mark Pfeiffer <ma...@ml...> > TCNZA EMC IB | Mobile: 0414 771 245 | Phone: +61 2 9378 5024 > Snail: L5, 48 Martin Place, Sydney, Australia > > ---- Legal ------ > Important: This email message and attachments (if any) are confidential > and may be legally privileged. If you are not the intended recipient, > you must not disclose, copy or use the information contained in it > in any way. If you have received this email in error, please advise > immediately by return email and delete this email and its attachments > (if any). Thank you. > > ------------------------------------------------------- > This sf.net email is sponsored by: > Battle your brains against the best in the Thawte Crypto > Challenge. Be the first to crack the code - register now: > http://www.gothawte.com/rd521.html > _______________________________________________ > log4perl-devel mailing list > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel -- Happy Trails. . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510)525-5217 |