How do I set up logs with Symfony on GCP?

I have a PHP Symfony app that I am running on the Google Cloud Platform standard environment.

When I run the server locally, I can make logs via the normal Symfony way and they show up in my console. So for example:

$logger->error("This is what an error looks like");

displays in the console as

May 7 21:38:55 |ERROR| APP This is what an error looks like

But when I upload to GCP, the error messages don’t appear in the logs viewer. Is there something I have to do to set up error logs for the Google Cloud Platform Console?

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *