I'm developing a PHP website. It is running on a shared Linux/Apache server. I am logging errors in two ways:
- By calling error_log($message, $message_type, $destination, $extra_headers);
- By calling my own logmsg() function that writes to the log file using fwrite($logf, $logmsg);
Sometimes when I request a page that fails to load, it fails to write anything to the log file, even though I am 99% certain that it will have executed a number of error_log() and logmsg() calls. I suspect that the output is getting stuck in some buffer somewhere. How do I get to see these log messages? Is there a way to flush the output to the log file? Without being able to see these messages it's very difficult to work out why the page is failing to load.
Thank you - Rowan