in reply to Re: Multiple processes, one log file?
in thread Multiple processes, one log file?
In fact it is not guaranteed. We reinvented our log wheel and 95% of log activity is on the same log file, and we find it very useful.
From perl docs, various web examples, this merlyn's webcolumn (written when I didn't even know what perl was) and extensive™ testing, I learnt that using flock() with LOCK_EX flag is the only way to have consistent updates/writes by many processes onto a single log file (or page-counters, for that matter), though this method is not reliable across platforms.
Not using flock resulted in mangled log files, with different processes log buffers being mixed and truncated at random.
|
|---|