From: mark p. <mar...@ed...> - 2002-11-17 22:25:36
|
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? > > > Pfeiffer, Mark (EDS) wrote: > > Mike sorry draggin my heals on this :-( > > > > I have uploaded: > > > > M/MA/MARKPF/Log-Dispatch-FileRotate-1.02.tar.gz > > > > to PAUSE for your consideration. It still needs plenty of work but at > > least it is a start. > > > > Please note EDS email sucs. Please use the Reply-To field if you wish to > > respond to me directly. Most "reasonable" email clients will understand. > > > > On Wed, 25 Sep 2002 19:54:02 EDT Msc...@ao...'s good news was: > > > > > > > > > In a message dated 9/25/02 4:21:35 PM Pacific Daylight Time, > > > mar...@ed... writes: > > > > > > > > > > > > > > > I'll have a little look at Log::Dispatch and some of its sub-classes to > > > see how it works. > > > > > > > > > > > > > > > Also, the Java implementation shows some interesting ideas: > > > > > > > > > http://jakarta.apache.org/log4j/docs/api/org/apache/log4j/RollingFileApp > > > ender.html > > > > > > Not that I'm implying you should provide the same interface, though :) > > > > > > -- Mike > > > > > > Mike Schilli > > > log...@pe... > > > http://perlmeister.com > > > http://log4perl.sourceforge.net > > > > > > > > > cheers > > markpf > > > > > > ------------------------------------------------------- > > This sf.net email is sponsored by: To learn the basics of securing > > your web site with SSL, click here to get a FREE TRIAL of a Thawte > > Server Certificate: http://www.gothawte.com/rd524.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 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. |