At 10:30 PM 06/10/02 -0400, Sam Tregar wrote:
>On Tue, 11 Jun 2002, Sergey Rusakov wrote:
>
>> open(ERRORLOG, '>>/var/log/my_log');
>> print ERRORLOG "some text\n";
>> close ERRORLOG;
>>
>> This bit of code runs in every apache child.
>> I worry abount concurent access to this log file under heavy apache
load. Is
>> there any problems on my way?
>
>You are correct to worry.  You should use flock() to prevent your log file
>from becoming corrupted.  See "perldoc -f flock()" for more details.

Maybe it's a matter of volume.  Or size of string written to the log.  But
I don't flock, and I keep the log file open between requests and only
reopen if stat() shows that the file was renamed.  So far been lucky.


-- 
Bill Moseley
mailto:[EMAIL PROTECTED]

Reply via email to