Stackdriver Error Reporting Stackdriver Error Reporting counts, analyzes and aggregates the crashes in your running cloud services. A centralized error management interface displays the results with sorting and filtering capabilities.
This sample Java application demonstrates how errors are automatically sent to Error reporting in applications running in App Engine Flex environment. It also demonstrates how to send custom error events using the Error Reporting API.
- Install Maven.
- Install and initialize GCloud SDK.
- Enable Stack Driver Error Reporting API. (Note : only required for logging custom events using the Error Reporting API)
Build your project with:
mvn clean package
Create a service account
and set the GOOGLE_APPLICATION_CREDENTIALS environment variable.
For local testing, we will be using the Jetty Maven plugin. Run:
mvn jetty:run
Access http://localhost:8080/error endpoint.
After accessing the /error endpoint, check the error reporting console.
Confirm that you see the custom error reported using the error reporting API.
Run:
mvn appengine:deploy
Access [https://YOUR_PROJECT_ID.appspot.com/error] endpoint.
After accessing the /error endpoint, check the error reporting console.
Confirm that you see:
- IllegalArgumentException logged via the standard logging framework.
- Custom error reported using the error reporting API.
- Runtime exception.