0

I am trying to deploy a spring boot app to google cloud app engine. It is going ok except I can't seem to see the spring boot logs in google app engines log viewer https://console.cloud.google.com/logs/viewer. Maybe I am looking in the wrong place?

I am using the gradle google app engine plugin.

to debug this I have ran the docker image generated by the google app engine plugin locally and it prints logs to screen.

How should I start debugging this issue?

2 Answers 2

2

There's relevant documentation about logging in the java flex environment here: https://cloud.google.com/appengine/docs/flexible/java/writing-application-logs

Since you can see the logs output from your service fine when you run locally, they should already be going to std out or err. So the only thing else I could expect would be to ensure you're setting the "GAE Application" from the dropdown menu per step 3 in that document. Pasted below:

  1. Go to the Stackdriver > Logging page in the GCP Console
  2. Select an existing GCP project at the top of the page.
  3. From the drop-down menus, select "GAE Application" as your resource type to see your App Engine logs.
2
  • I thought I don't need that webapp folder if I am using spring boot? I thought the webapp folder is for standard environments and I am using a flex environment? Is my understanding incorrect?
    – Funzo
    Sep 18, 2019 at 21:02
  • Oh i didn't realize you were using the flex environment. In that case yes you're right the output should just be going to standard out. I'll try to fix my answer.
    – Nicholas
    Sep 18, 2019 at 21:37
0

To have Spring Boot log to the Application log viewer, check out the following document. If you already followed this check to see if your logging.properties file if it is in the WEB-INF as per the document and try placing it in the src/main/resources instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.