in reply to File Locking in CGI programs
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 ;-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: File Locking in CGI programs
by perrin (Chancellor) on Jul 06, 2005 at 03:18 UTC |