In computing, logging refers to a record of events that have occurred over a certain time period. In GCP, logs are associated with projects; that is, each project will have separate logs. Logs can be used for debugging, tracking billing, analyzing performance, or just as proof of an event or task. Stackdriver allows users to view, filter, and export logs:
As shown in the diagram, the Stackdriver logging component is made up of three elements:
- Logging APIs, which are used to fetch record logs.
- Storage, that is, cloud storage buckets. The log export APIs have access to cloud storage buckets where logs can directly be streamed.
- A user interface to interact fluently with logs.
Logs are stored as objects of the type LogEntry. Log entries can be created by GCP or AWS services, and they use the entries.write method to write the logs. Mostly, the logs are automatically named...