Challenge 3: Logging and Monitoring
Previous Challenge Next Challenge
Introduction
Tracing, profiling, and debugging are essential tools for any programmer, but even the most experienced programmers can’t live without console.log
or System.out.println
. On Cloud Run, all the logs your app writes to stdout (and more) ends up in Cloud Logging.
If you use structured logging (that’s writing a JSON-formatted message), you can add severity, correlate requests with logs, and add additional metadata.
Description
Browse to /logging
on your deployed service. This should be generating some logs, visible in Logs section of Cloud Run UI. However it’s not working at the moment, fix the issue by editing service/routes/logging.js
Success Criteria
- Verify that the logs end up in Cloud Logging
- The tests in
logging.test.js
are all passing - The code changes are only in the
logging.js
file