i'm using PHP as a server backend, to create API, and hence it doesn't console log to browser.
However I'm finding it very hard to debug without using console, and I have to use error_log(json_encode($variable)) all the time to write to error log to see what is being returned/received.
Is there anyway I can 'monitor' the API, and use console.log or similar to write to somewhere, where I can view my output live?
Thanks @Chris, for answering my need. So I'm using the following codes to do a simple print to text file and use tail to see the live output. Works brilliantly.
function mylog($data) {
$myFile = "/home/user/html/log.txt";
$fh = fopen($myFile, 'a') or die("can't open file");
fwrite($fh, json_encode($data, JSON_PRETTY_PRINT));
fclose($fh);
}