问题描述:

Situation:

I want to check some variables to see if they give the right values by logging the values of the variables in to the GAE Launcher Log.

Question:

How can I log a variable in the Google App Engine Launcher Log? I tried using syslog, but this doesnt work.syslog(LOG_DEBUG,"Messagge: $data");

网友答案:

If you echo something in your code then it will be displayed on appengine log. Or you can use PHP syslog() function.

Details can be found here

Example:

if (authorizedUser()) {
  echo '<p>Welcome authorized user</p>';
  syslog(LOG_INFO, 'Authorized access');
} else {
  echo 'Go away unauthorized user<p />';
  syslog(LOG_WARNING, "Unauthorized access");
}
相关阅读:
Top