I'm using Google App Engine standard environment to host a python-flask-application and I'm having issues to get the errors to show up in StackDriver Error Reporting. By default Google App Engine should log errors to StackDriver Error Reporting, but it doesn't.
I've had errors before that showed up in StackDriver Error Reporting, but I can't reproduce that. The errors seem to go straight to the Server-Errors section and not to the Application-Errors. But it seems logical to me that both are logged in StackDriver Error Reporting.
I did some debugging in order to get it working using routes /error and /500. The result was the following:
- The errors show up in the Google App Engine overview:

- Both are visible in the logs:

- But nothing shows up in StackDriver Error Reporting:

Would anyone have an idea why this is the case?
UPDATE: I found that using the flask.logger seems to be the problem. Using logging works ok and ends up in StackDriver Error Reporting (except for some formatting issues). Both do end up in the logger though. I am using a logging.StreamHandler to register to flask.logger using addHandler. My best guess is that there is something wrong with the formatting of the logging.StreamHandler. Investigating further.