ในตอนนี้ เราจะบันทึกข้อมูลที่กําหนดเองบางอย่างไปยัง Google Cloud Logging เราจะดูตัวอย่าง Python ที่ใช้ตัวแทรก gRPC แบบกําหนดเองเพื่อดึงข้อมูลคําขอและการตอบกลับ ตลอดจนข้อมูลเมตาบางอย่าง เช่น สถานะความสําเร็จและเวลาที่ใช้ ไว้ในบันทึกที่กําหนดเอง จากนั้นเราจะส่งบันทึกดังกล่าวไปยังระบบคลาวด์โดยใช้ Google Cloud Logging API
การส่งบันทึกของไคลเอ็นต์ไปยัง Google Cloud
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-21 UTC
[null,null,["อัปเดตล่าสุด 2025-08-21 UTC"],[[["\u003cp\u003eThis episode demonstrates how to log custom data to Google Cloud Logging using Python.\u003c/p\u003e\n"],["\u003cp\u003eThe example uses a gRPC interceptor to capture request/response data, success status, and elapsed time for logging.\u003c/p\u003e\n"],["\u003cp\u003eCustom logs are generated and sent to Google Cloud using the Google Cloud Logging API.\u003c/p\u003e\n"]]],[],null,["# Sending Client Logs to Google Cloud\n\nIn this episode, we log some custom data to Google Cloud Logging. We walk through a Python example which uses a custom gRPC interceptor to extract request and response data, as well as some metadata like success status and elapsed time, into custom logs. We then send those logs to the cloud using the Google Cloud Logging API.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e"]]