How to enable an application to create custom logs
Having already reviewed what Cloud Logging is and what some of the best practices for recording log events in the cloud are, we can proceed to look at how to enable our applications to record logs in Cloud Logging.
In this section, we will review options to allow our applications to record logs using Google Cloud services, to enable us to carry out troubleshooting, analysis, and auditing tasks.
Enabling an app to create custom logs
Depending on the service we use in Google Cloud to deploy our applications, we will have to perform different tasks to enable the logging from our application to Cloud Logging.
For example, in the case of Cloud Functions, Cloud Run, Google Kubernetes Engine (GKE), App Engine, and Compute Engine, the integration with Cloud Logging is done by default; we only have to worry about using the Cloud Logging library to record our logs.
We will use a base application created in Node.js using the Cloud...