TokyoDan
TokyoDan

Reputation: 196

How can I output debugging messages to the log with PHP on Google App Engine?

What PHP statements can I use (e.g. echo/print/log_message) to output to the system log with PHP on Google App Engine?

I tried with very simple print, echo, log_message statements but everything I try gives me errors. I read that such statements are not part of the PHP on GAE.

Upvotes: 1

Views: 1150

Answers (2)

HClx
HClx

Reputation: 481

to output a debug log in app engine I use:

syslog(LOG_DEBUG,'Your string');

For more information try app engine PHP docs, important to notice that they don't mention the LOG_DEBUG there but it works fine.

If you want to see the DEBUG level in the local development server started with dev_appserver.py use --log_level=debug. You can read more about local development server on the docs.

Hope it helps.

Upvotes: 4

Stuart Langley
Stuart Langley

Reputation: 7054

Use syslog to write to the applications logs.

In production you will see these logs in the admin console for your application.

Upvotes: 1

Related Questions