The Google Cloud Python logging library has received a “significant update” for monitoring and troubleshooting Python-based containerized apps in the cloud and serverless environments.

On GitHub, the new version of ‘google-cloud-logging’, v3.0, provides Python developers with real-time insights into the performance of an application hosted on
compute infrastructure. The library’s key change is that it now supports Python applications in serverless settings.After developers have disabled apps in Google Cloud’s serverless environments, the latest version of google-cloud-logging fixed an issue that caused unsent log batches to be lost. Cloud Run, a managed service for containerized programs, and Cloud Functions, a competitor to
Lambda and Functions Serverless Compute, are two examples.Google has issued the following statement:
“Users reported that the library would occasionally drop logs on serverless environments like Cloud Run and Cloud Functions. This was because the library would send logs in batches over the network. When a serverless environment would spin down, unsent batches could be lost. This version fixes the issue by using Google Cloud Platform’s built-in “structured JSON logging functionality” in Google Kubernetes Engine, Cloud Run, and Cloud Functions. In these environments, it will automatically use the new StructuredLogHandler and write logs as JSON strings printed to standard out.”
Even if the code that generated the logs has spun down, the parsed logs are automatically sent to Cloud Logging. To enable troubleshooting an application easier, Google’s cloud-logging tool now detects and attaches metadata about an environment to each log message.
Instead of merely logging string payloads as in previous versions, this version of cloud logging adds support for logging JSON payloads for LogEntries in the standard Python logging library integration. More information can be found in Google’s migration guide for version 3.0.
Google Cloud’s Python logging library just got a ‘major’ update https://t.co/Lhj9kmtj03 via @ZDNet & @LiamT
— Manny James (@iammannyj) February 10, 2022
The Python logging tool is part of Google’s endeavor to increase tooling capabilities in order to provide developers with visibility into their applications and allow them to run reliable production systems.
Although Google Cloud continues to lose money, its sales are expanding faster than those of Amazon Web Services and Microsoft Azure. According to analyst Canalys, Google Cloud accounted for 9% of the $53.5 billion spent on cloud infrastructure services by businesses in Q4 2021. AWS accounted for 33% of the market, while Microsoft Azure accounted for 22%.
