|
From: Mike S. <msc...@ao...> - 2003-09-26 16:42:01
|
Viner, David wrote: > 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? If you use the same appender in different processes or threads, and the appender doesn't take any precautions to separate the messages, they'll end up randomly interleaved. To avoid this, you could * write a new file appender that obtains a mutex lock before it writes (but that's going to be slow) * use different appenders for different processes -- -- Mike Mike Schilli m...@pe... |