GAE Standard PHP72 - syslog() not logging to request_log anymore. What to do?

146 views
Skip to first unread message

Christian Wiedemann

unread,
Oct 26, 2018, 10:05:21 AM10/26/18
to Google App Engine

Hello,

with GAE runtime php72, logs, that are written using syslog() do not longer appear in the standard Logging overview and are not marked with icons and colors by their severity.

You need to select additional logs in the second dropdown to see what you logged.

Logs sent by PHP itself or by error_log() appear under "stderr" 
and for custom logs sent by syslog() you need to select "/dev/log" and the error messages are just appearing in JSON format.

In php55 each notice/warning/error could be identified directly by looking on the Logging page or filtering by log level. 
Now identifying of errors is much harder.

Is there a better way to log custom logs or to visualize the logs (without Stackdriver)?
Are there plans to redirect logs with their severity to the "request_log" list?

For instance:
<? syslog(LOG_DEBUG, "Test") ?>
leads to
{"severity":7,"facility":1,"timestamp":"2018-10-26T13:14:54Z","hostname":"","app_name":"php-fpm","procid":"","msgid":"","structured_data":"","message":"pool app: Test"}


Yours Christian

----------------------------------------------------------------------------------------------
Rechtlicher Hinweis nach §35a Abs. 1 S. 1 im GmbHG. 

Wabion GmbH
Geschäftsfuehrer: Michael Walther, Volkmar Binder
GmbH Sitz: Esslingen, HRB 354492 (Amtsgericht Stuttgart)

This e-mail (and/or attachments) is confidential and may be privileged. Use or disclosure of it by anyone other than a designated addressee is unauthorized.
If you are not an intended recipient, please delete this e-mail from the computer on which you received it. We thank you for notifying us immediately. 
----------------------------------------------------------------------------------------------

Amit (Google Cloud Support)

unread,
Oct 29, 2018, 5:51:37 PM10/29/18
to Google App Engine

Hello Christian


To visualize your logs,you can export your log using this documentation so that they can be used with available external tools. You can also export it to BigQuery if you want to analyze the logs from the Google Cloud Platform. This documentation explains how to querying and analyze audit logs, as an example, using BigQuery.


As this document mentioned, “When your application handles a request, it can write its own logging messages to stdout and stderr. Write your application logs using stdout for output and stderr for errors. These files are automatically collected and can be viewed in the Logs Viewer. Note that this does not provide log levels that you can use for filtering in the Logs Viewer; however, the Logs Viewer does provide other filtering, such as text, timestamp, etc.”, which looks like an intended behavior that stackdriver only shows the logs which is written using stderr and stdout for PHP[7.2]. To address your second question,I have created a feature request, so that the log level can be redirected with their severity to the "request_log" list. Please note there is no guarantee or ETA for any feature request. Future updates will be posted in this feature request.

Reply all
Reply to author
Forward
0 new messages