I want to write a message to log which is coming from http request. I search many forums and still couldn't do that? Can anyone please help me?
How to create log file in php
Collapse
X
-
You just have to have your script open a file for appending, and then write what you wish to write to this file. And then close the file again (for good coding practice although the file will be closed when the script ends).
The file needs to be in a location that your PHP has read and write permissions to.
I am not sure what will occur in the event that your script is called simultaneously by more than one user, where there is an attempt to open and write to the log file by more than one script instance at the same time. Maybe someone else with more experience here can answer that.
Comment