From: William M. <wi...@kn...> - 2004-01-13 13:59:03
|
On Tue, Jan 13, 2004 at 01:16:16AM -0800, Mike Schilli wrote: > Oh, and for now, something like > > use Log::Log4perl; > > unless($Log::Log4perl::Logger::INITIALIZED) { > Log::Log4perl->init(...); > } > > might do the trick (at least if it's single-threaded) ... OK, I'll add that to my code just to be on the safe side. I am single-threaded but am running multiple processes (typical Apache server under Linux stuff). I guess each process will have it's own Log4perl object, but what if I run multiple applications that use Log4perl? It looks like you are calling a class attribute. At startup, it seems like one app could initialize the object and the next would not initialize it's logger object and run into problems. But perhaps I'm not grokking how you have the Log4perl system setup. BTW, why won't this code work in a multi-threaded environment? Is it because Log4perl is not ready for it or something more insidious? It seems that some distros are starting to ship Perl with threading enabled. I'm not sure I'm ready for this brave new world..... Thanks, William -- Knowmad Services Inc. http://www.knowmad.com |