|
Posted by Sjoerd on 03/30/06 21:13
Roman Ziak wrote:
> 1. For performance reasons, the log messages should be collected in
> array and then flushed into the file
This is very hard. After a request has been done, the PHP script is
done and its variables are no longer there. You would have to use
shared memory or something like that. A file is much easier.
> 2. Is there some way in PHP to synchronise file access from another
> concurrent request ?
flock()
You probably want to write a Apache-like rule, so you can use standard
tools to process it. For performance, first put the rule in a string,
than lock the file, write the string, unlock the file. That should work
fast enough.
[Back to original message]
|