Simply use PHP’s standard syslog function to write logs
syslog(LOG_INFO, "Authorized access"); syslog(LOG_WARNING, "Unauthorized access");
You can see the logs from "Stackdriver Logging" ( https://console.cloud.google.com/logs )