The very first time I used a database in a web app, it was to avoid all file locking problems. So, of course, with that background, this just screams to be a database problem.
Rather than logging to a file, insert into a logging table in your database. You already have a connection opened to it, just use it.
Note also that, for the purpose of logging, syslog is also a database. It solves all these same problems - you're communicating with a single server that interfaces to the file(s) transparently. (If that server is multi-process or multi-threaded, or even multi-machine, that can be solved by whoever writes the server, and you don't need to worry about it.)
I actually worry about very few file locking scenarios now ;-)
In reply to Re: File Locking in CGI programs
by Tanktalus
in thread File Locking in CGI programs
by enemyofthestate
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |