My app is running with dev_appserver but app is not building the response as I'm expecting it (I get a blank page)
See here: App Engine no output in browser
It has been suggested I debug the requests but I'm not sure how to do this.
What PHP code do I need to debug my Wordpress app and where do I place that code in my project? Where will the output log appear?
Update - Making Request log
Is it correct to:
1/ Add following code this to index.php then run dev_appserver.py
<?php
use google\appengine\api\log\LogService;
// LogService API usage sample to display application logs for last 24 hours.
$options = [
// Fetch last 24 hours of log data
'start_time' => (time() - (24 * 60 * 60)) * 1e6,
// End time is Now
'end_time' => time() * 1e6,
// Include all Application Logs (i.e. your debugging output)
'include_app_logs' => true,
// Filter out log records based on severity
'minimum_log_level' => LogService::LEVEL_INFO,
];
$logs = LogService::fetch($options);
?>
2/ and after that, add to body ...
<?php foreach ($logs as $log): ?>
<h3>REQUEST LOG</h3>
<ul>
<li>IP: <?= $log->getIp() ?></li>
<li>Status: <?= $log->getStatus() ?></li>
<li>Method: <?= $log->getMethod() ?></li>
<li>Resource: <?= $log->getResource() ?></li>
<li>Date: <?= $log->getEndDateTime()->format('c') ?></li>
<li>
<?php foreach ($log->getAppLogs() as $app_log): ?>
<strong>APP LOG</strong>
<ul>
<li>Message: <?= $app_log->getMessage() ?></li>
<li>Date: <?= $app_log->getDateTime()->format('c') ?></li>
</ul>
<?php endforeach ?>
</li>
</ul>
<?php endforeach ?>
Do I place all this code in the index.php file? Does the first lot of code go in the head or the body of the document?