From: <msc...@ao...> - 2002-12-17 06:10:33
|
In a message dated 12/16/2002 2:09:49 PM Eastern Standard Time, "Wiggins d'Anconia" <wi...@da...> writes: >First off Log4perl rules. Thanks, we're certainly happy you like it! :) >Our app will >become a daemon, then fork once to watch a series of directories, and >then fork again to process files that fall into those directories Log::Log4perl has been designed with multi-processing/threading in mind. In the multi-threading area we do have some issues regarding config_and_watch(), especially if you change the config file in weird ways while the program is running. In the multi-processing area I'm not aware of any problems (but please file a bug if you find any :). Regarding concurrency in general, please make sure to know about the following: If you have one Log4perl config file which the daemon reads and passes the Log4perl configuration on to its children, you might end up with several processes sharing a single appender instance in different process spaces. Calls to this appender are *not* synchronized. Which means that if you have a, say, out-of-the-box Log::Dispatch::File appender pointing to an open file, and all processes try to log a message concurrently, you might have mingled log lines. This is extremely rare, though, I've never seen it happening even under high concurrent load. If you can't live with that, you can still write your own appender which synchronizes calls at the OS level (with semaphores or the like), but it will be slower. Let me know how it works out for you, we're certainly gonna help should you have any questions. -- -- Mike ############################ # Mike Schilli # # log...@pe... # # http://perlmeister.com # # log4perl.sourceforge.net # ############################ |