From: Viner, D. <dv...@ya...> - 2003-09-24 23:56:14
|
Hi, Sorry for this newbie question. I looked at the docs, but I couldn't find an answer. I want to use a file-based logger, like Log::Dispatch::File or something similar, and have a logger object initialized in a parent process. When the parent forks a child, that child process will have a copy of the logger object. Can I safely use that duplicate logger object in the child? Or will that causes messages from the parent and child to interleave? I'm not concerned about mixing complete messages from child and parent like this: parent > msg1 child > msg2 But, what really concerns me is the interleaving of messages in the same line like this: parchild > ent > msmsg1g2 Is there protection against this? Or should the forked child call Log::Log4perl->reset(); Log::Log4perl->init() to get a seperate logger object? thanks again. dave viner p.s. - i realize this question is similar to the question posed in the Apache::Reload email, but I wanted to clarify for my application (which doesn't use apache or mod_perl). |