ตั้งค่า Cloud Logging
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เปิดใช้ Cloud Logging
Fleet Engine ควรเปิดใช้การบันทึกโดยอัตโนมัติ
- เปิด Logs Explorer
ป้อนคำค้นหาต่อไปนี้
resource.type:"fleetengine.googleapis.com"
หากผลลัพธ์ของคำค้นหาแสดงบันทึก แสดงว่าเปิดใช้การบันทึกแล้ว
หากไม่เห็นบันทึกใดๆ แสดงในผลลัพธ์ของการค้นหานี้
อาจไม่ได้เปิดใช้ Cloud Logging สำหรับโปรเจ็กต์ของคุณ หากต้องการเปิดใช้
การบันทึก Cloud Logging โปรดติดต่อทีมสนับสนุนของ Google Maps Platform
เปิดใช้บันทึกการใช้งานที่ถูกจำกัด
ตามข้อกำหนดเฉพาะของบริการการเดินทาง ระบบอาจเก็บข้อมูลบันทึกบางส่วนที่ Fleet Engine สร้างขึ้นไว้เพียง 30 วัน
Fleet Engine จะติดป้ายกำกับบันทึกเหล่านั้นเป็น TOS_RESTRICTED
และจัดเรียงลงในที่เก็บข้อมูลบันทึกที่มีการจำกัดการเก็บรักษา ซึ่งคุณต้องสร้างตามที่แสดงด้านล่าง
ระบบจะกำหนดข้อมูลบันทึกอื่นๆ ทั้งหมดไปยังที่เก็บข้อมูลเริ่มต้น ซึ่งจะเก็บรักษาได้นานขึ้นตามที่กำหนดไว้ในข้อกำหนดเฉพาะของบริการการเดินทาง
ดูที่เก็บข้อมูลบันทึกใน Google Cloud
Console เกี่ยวกับการปรับแต่งที่เก็บข้อมูลบันทึกและระยะเวลาการเก็บรักษา
คุณสามารถรวมข้อมูลจากบันทึกที่จำกัดและบันทึกเริ่มต้นเพื่อวิเคราะห์
ชุดข้อมูลบันทึกที่สมบูรณ์ได้
ทำดังนี้เพื่อเปิดใช้บันทึกการใช้งานที่จำกัด
สร้างซิงก์และที่เก็บข้อมูลสำหรับบันทึกที่มีการจำกัดการใช้งาน แล้วกรองบันทึกลงในที่เก็บข้อมูลที่เหมาะสม
โปรดติดต่อทีมสนับสนุนเพื่อเปิดใช้บันทึกการใช้งานที่จำกัด
โปรดดูรายละเอียดที่หัวข้อด้านล่าง
สร้าง Sink และที่เก็บข้อมูลสำหรับบันทึกที่จำกัดในโปรเจ็กต์
ใน Logs Explorer ให้เปิดหน้าLog Router ในการนำทางด้านซ้าย
แก้ไขที่เก็บข้อมูลการบันทึกเริ่มต้นเพื่อยกเว้นบันทึกที่มีการจำกัดการใช้งาน
- ในส่วน Log Router Sinks ให้เลือกที่เก็บข้อมูลการบันทึกเริ่มต้น
- เลือกแก้ไข Sink จากเมนูการดำเนินการ
- ไปที่ส่วนเลือกบันทึกที่จะกรองออกจาก Sink แล้วคลิกปุ่มเพิ่มการยกเว้น
- ตั้งค่าชื่อตัวกรองการยกเว้นเป็น ExcludeRestrictedLogs
- ในช่องสร้างตัวกรองการยกเว้น ให้วางตัวกรองต่อไปนี้
labels.restriction="TOS_RESTRICTED"
- คลิกอัปเดตแหล่งข้อมูล
สร้างที่เก็บข้อมูลการบันทึกที่จำกัดเพื่อจัดเก็บบันทึกการใช้งานที่จำกัด คุณทำได้โดยสร้างซิงก์และที่เก็บข้อมูลสำหรับบันทึกทั้งหมด แล้วยกเว้นบันทึกที่ไม่จำกัด
- ในหน้า Log Router ให้เลือกสร้าง Sink ที่ด้านบน
- กรอกรายละเอียดซิงก์ ดังนี้
- ชื่อ: RestrictedLogs
- คำอธิบาย: กำหนดเส้นทางบันทึกการใช้งานที่จำกัดของ Fleet Engine
- คลิกถัดไป
- กรอกข้อมูลปลายทางของซิงก์
- เลือกบริการซิงก์: ที่เก็บข้อมูลการบันทึก
- เลือกที่เก็บข้อมูลบันทึก: เลือกสร้างที่เก็บข้อมูลบันทึกใหม่
- ในกล่องโต้ตอบรายละเอียดที่เก็บข้อมูล ให้กรอกข้อมูลต่อไปนี้
- ชื่อ: จำกัด
- คำอธิบาย: มีบันทึกการใช้งานที่จำกัดของ Fleet Engine
- ปล่อยให้ส่วนที่เหลือเป็นไปตามเดิม แล้วคลิกถัดไป
- ตั้งค่าระยะเวลาเก็บรักษาเป็น 30 วัน (ระยะเวลาการเก็บรักษาต้องไม่เกิน 30 วัน)
- คลิกสร้างที่เก็บข้อมูล
- กลับไปที่กล่องโต้ตอบการสร้าง Sink แล้วปล่อยให้ส่วนบันทึกที่จะรวมไว้ใน Sink
ว่างไว้
- ในส่วนบันทึกที่จะกรองออกจาก Sink ให้คลิกเพิ่มการยกเว้น
แล้วกรอกข้อมูลต่อไปนี้
- ชื่อตัวกรองการยกเว้น: ExcludeNonRestrictedLogs
- ตัวกรองการยกเว้น:
NOT (resource.type =
"fleetengine.googleapis.com/Fleet" OR resource.type =
"fleetengine.googleapis.com/DeliveryFleet") NOT (labels.restriction
= "TOS_RESTRICTED")
- คลิกสร้าง Sink
- ไปที่การสนับสนุนของ Google Maps Platform
- คลิกสร้างเคสเพื่อเริ่มคำขอการสนับสนุนใหม่
ระบุข้อมูลต่อไปนี้
- รหัสโปรเจ็กต์ที่จะเปิดใช้
- อีเมลของผู้ที่ขอเปลี่ยนแปลง บุคคลนี้ควรมีสิทธิ์เข้าถึงระดับแก้ไขในโปรเจ็กต์ Google Cloud ที่คุณแสดง
โปรดยอมรับข้อกำหนดต่อไปนี้โดยเขียนว่าใช่ การเปิดใช้เนื้อหา Google Maps ที่จำกัดการใช้งานใน Cloud Logging แสดงว่าคุณยอมรับที่จะปฏิบัติตามข้อกำหนดของ Google Maps Platform และข้อกำหนดเฉพาะสำหรับบริการการเดินทาง รวมถึงข้อกำหนดด้านการแคชและการใช้งานที่ได้รับอนุญาตที่เกี่ยวข้องกับเนื้อหา Google Maps
เมื่อทีมสนับสนุนจัดการคำขอของคุณแล้ว คุณจะได้รับการยืนยันว่า
มีการเปิดใช้การบันทึกสำหรับโปรเจ็กต์ของคุณแล้ว
ขั้นตอนถัดไป
ดูวิธีทำงานกับบันทึกใน Logs Explorer
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-31 UTC
[null,null,["อัปเดตล่าสุด 2025-08-31 UTC"],[[["\u003cp\u003eFleet Engine automatically enables logging, verifiable via a query in the Logs Explorer using \u003ccode\u003eresource.type:"fleetengine.googleapis.com"\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eRestricted-use logs, labeled \u003ccode\u003eTOS_RESTRICTED\u003c/code\u003e, require a dedicated bucket with a 30-day retention period due to the Mobility Service Specific Terms.\u003c/p\u003e\n"],["\u003cp\u003eEnabling restricted-use logs involves creating a separate sink and bucket, then contacting Google Maps Platform Support for activation.\u003c/p\u003e\n"],["\u003cp\u003eFleet Engine logs may contain sensitive information and require careful access management using Google Cloud's Identity and Access Management for Cloud Logging.\u003c/p\u003e\n"]]],[],null,["Enable Cloud Logging\n\nFleet Engine should automatically have logging enabled.\n\n1. Open the [Logs Explorer](https://cloud.google.com/logging/docs/view/logs-explorer-interface).\n2. Enter the following query:\n\n resource.type:\"fleetengine.googleapis.com\"\n\nIf the results for the query list logs, then logging is enabled.\n\nIf you don't see any logs listed in the results for this query,\nCloud Logging may not be enabled for your project. To enable\nCloud Logging, contact [Google Maps Platform Support](https://console.cloud.google.com/google/maps-apis/support).\n\nEnable restricted use logs\n\nIn accordance with the [Mobility Service Specific Terms](/maps/documentation/transportation-logistics-terms/mobility/service-terms), some\nof the log data that Fleet Engine generates may only be retained for 30 days.\nFleet Engine labels those logs as `TOS_RESTRICTED` and sorts them into a\nrestricted-retention log bucket, which you must create as shown below.\n\nAll other log data is assigned to the default bucket where it can be retained\nlonger, as defined in the [Mobility Service Specific Terms](/maps/documentation/transportation-logistics-terms/mobility/service-terms).\nSee [Logs Storage](/maps/documentation/mobility/operations/cloud-logging/console.cloud.google.come/logs/storage) in the Google Cloud\nConsole about customizing your log buckets and their retention periods.\n\nFor analysis, you can join the data from restricted and default logs for a\ncomplete set of log data.\n\nDo the following to enable restricted use logs:\n\n1. Create a sink and bucket for restricted-use logs, and filter logs into their\n appropriate buckets.\n\n2. Contact support to enable restricted-use logs.\n\nFor details, see the following sections.\n\nCreate a sink and bucket for restricted logs in your project\n\n1. In the [Logs Explorer](https://cloud.google.com/logging/docs/view/logs-explorer-interface), in the left-hand\n navigation, open the **Log Router** page.\n\n2. Modify the _Default logging bucket to exclude restricted-use logs.\n\n 1. Under **Log Router Sinks**, select the _Default logging bucket.\n 2. Choose **Edit sink** from the **Actions** menu.\n 3. Go to the **Choose logs to filter out of sink** section and click the **Add Exclusion** button.\n 4. Set the **Exclusion filter name** to *ExcludeRestrictedLogs*.\n 5. In the **Build and exclusion filter** box, paste this filter: `labels.restriction=\"TOS_RESTRICTED\"`\n 6. Click **Update sink**.\n3. Create a restricted logging bucket to store the restricted-use logs. You do\n this by creating a sink and bucket for all logs, and then excluding the\n non-restricted logs.\n\n 1. On the [Log Router page](https://console.cloud.google.com/logs/router), towards the top, select **Create sink**.\n 2. Fill in the **Sink details** :\n 1. Name: *RestrictedLogs*\n 2. Description: *Routes Fleet Engine restricted-use logs.*\n 3. Click **Next**.\n 4. Fill in the **Sink destination** :\n 1. Select Sink service: Logging bucket\n 2. Select log bucket: Select **Create new log bucket**.\n 3. In the **Bucket details** dialog, fill in:\n 1. Name: *Restricted*\n 2. Description: *Contains Fleet Engine restricted-use logs.*\n 4. Leave the rest as is and click **Next**.\n 5. Set the **Retention period** to 30 days. (The retention period must not exceed 30 days.)\n 6. Click **Create bucket**.\n 5. Back in the sink creation dialog, leave the **Logs to include in sink** section empty.\n 6. In the **Logs to filter out of sink** section, click **Add Exclusion** and fill in:\n 1. Exclusion filter name: *ExcludeNonRestrictedLogs*\n 2. Exclusion filter: `NOT (resource.type =\n \"fleetengine.googleapis.com/Fleet\" OR resource.type =\n \"fleetengine.googleapis.com/DeliveryFleet\") NOT (labels.restriction\n = \"TOS_RESTRICTED\")`\n 7. Click **Create sink.**\n\nContact support to enable restricted-use logs\n\n1. Go to [Google Maps Platform Support](https://console.cloud.google.com/google/maps-apis/support)\n2. Click **Create Case** to start a new support request.\n3. Provide the following information:\n\n - Project ID(s) to enable.\n - Email address of the person requesting the change. This person should have edit access to the Google Cloud Projects you are listing.\n4. Agree to the following by writing **Yes** : *By enabling restricted-use\n Google Maps Content in Cloud Logging, you agree to adhere to the\n [Google Maps Platform terms](https://cloud.google.com/maps-platform/terms/) and [Mobility service specific\n terms](/maps/documentation/transportation-logistics-terms/mobility/service-terms), including caching and permitted use requirements as they relate\n to Google Maps Content.*\n\nOnce the support team handles your request, you will receive a confirmation that\nlogging has been enabled for your project.\n| **Note:** Fleet Engine logs may contain sensitive vehicle and trip information. You can restrict and audit access to these logs with Google Cloud [Identity and Access Management for Cloud Logging](https://cloud.google.com/logging/docs/access-control).\n\nWhat's next\n\nLearn how to [Work with logs in Logs Explorer](/maps/documentation/mobility/operations/cloud-logging/work-with-logs)."]]