I have a single page app which does all it’s work via ajax calls. Now, I would need to log the ajax calls to a single file. I’ve done the logging and it works, but since I can’t stress test the behaviour I’m interested in your oppinions: what happens if two or more users click “save” and therefor engage the function for saving the “record” to a single file at the same time. Won’t the script throw an error if it will not be able to write to an already open file (open by a potentialy paralel “save” request)? Is there some method I can use so that I make sure the “record” has been saved?
Share
Why not use a logging framework which already takes care of this ?
See: https://stackoverflow.com/questions/341154/php-logging-framework