Closed beppe9000 closed 7 years ago
Hi @beppe9000. No, that is not possible. The logging requires sending an HTTP header which has to be sent before the request body. What you can do is use output buffering in your application, but that is outside the scope of this project.
My php script must be in real time, as the data is continuously updated and the script has a very long execution limit.
Maybe a scheme to buffer the logs could be added? For example the logs are stored in memory as a session variable, while the page outputs an "LogKey" header that is subsequently used as a parameter to an endpoint that outputs the stored logs. Every second the browser polls logs from the php endpoint, ending one second after the main page is done loading.
I have a php script that streams real-time logs and does some operations based on those logs. Is it ok to log after the headers and part of body have already been sent?