From: Kevin G. <ke...@go...> - 2002-11-20 18:24:34
|
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 |