بنية سجلّ التسجيل في السحابة الإلكترونية
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تمثّل Cloud Logging السجلات باستخدام نوع البيانات LogEntry
، الذي يحدّد البيانات الشائعة لجميع إدخالات السجلّ بالإضافة إلى الحِملات المحدّدة التي يمكن أن تتضمّنها خدمات Google Cloud. لمزيد من التفاصيل، يُرجى الاطّلاع على LogEntry.
يتم تقسيم السجلات الطويلة إلى عدة إدخالات سجلّ. يمكنك الاطّلاع على التعامل مع السجلات المقسّمة في هذه المستندات.
أمثلة على إدخالات السجلّ
يعرض المثال التالي LogEntry
لسجلّ UpdateVehicle
. يقع طلب RPC واستجابته داخل الحقل jsonPayload
.
{
"insertId": "c6b85fbc927343fc8a85338c57a65733",
"jsonPayload": {
"request": {
"header": {4},
"updateMask": "deviceSettings",
"vehicleId": "uniqueVehicleId",
"vehicle": {2}
},
"response": {
"name": "providers/example-project-id/vehicles/uniqueVehicleId",
"availableCapacity": 2,
"state": "VEHICLE_STATE_OFFLINE",
"maximumCapacity": 2,
"vehicleType": {1},
"supportedTrips": {1}
},
"@type": "type.googleapis.com/maps.fleetengine.v1.UpdateVehicleLog"
},
"resource": {
"type": "fleetengine.googleapis.com/Fleet",
"labels": {2}
},
"timestamp": "2021-01-01T00:00:00.000000000Z",
"labels": {2},
"logName": "projects/example-project-id/logs/fleetengine.googleapis.com%2Fupdate_vehicle",
"receiveTimestamp": "2021-01-01T00:00:00.000000000Z"
}
في حال ظهور خطأ RPC، سيتم محو الحقل responseVehicle
، وسيتم ضبط الحقل errorResponse
وتعبئته خلال jsonPayload
.
{
"insertId": "c6b85fbc927343fc8a85338c57a65733",
"jsonPayload": {
"errorResponse": {
"httpStatusCode": 404,
"code": "NOT_FOUND",
"message": "No entity with id invalidVehicleId exists"
},
"@type": "type.googleapis.com/maps.fleetengine.v1.UpdateVehicleLog",
"request": {
"vehicle": {3},
"updateMask": "deviceSettings",
"vehicleId": "fakeVehicleId",
"header": {4}
}
},
"resource": {
"type": "fleetengine.googleapis.com/Fleet",
"labels": {2}
},
"timestamp": "2021-01-01T00:00:00.000000000Z",
"severity": "ERROR",
"labels": {2}
"logName": "projects/example-project-id/logs/fleetengine.googleapis.com%2Fupdate_vehicle",
"receiveTimestamp": "2021-01-01T00:00:00.000000000Z"
}
لمزيد من المعلومات حول لغة طلب البحث في السجلّات، راجِع لغة طلب البحث في السجلّات.
للحصول على معلومات حول كيفية استخدام سجلّاتك لإنشاء مقاييس، راجِع نظرة عامة على المقاييس المستندة إلى السجلّات.
الخطوات التالية
التعامل مع إدخالات السجلّ الطويلة باستخدام السجلات المقسَّمة
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-08-31 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-08-31 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eCloud Logging utilizes the \u003ccode\u003eLogEntry\u003c/code\u003e data type to represent logs, encompassing common data and service-specific payloads, with details available in the provided LogEntry documentation link.\u003c/p\u003e\n"],["\u003cp\u003eExcessively long logs are divided into multiple log entries, and guidance on handling these split logs is provided in the linked documentation.\u003c/p\u003e\n"],["\u003cp\u003eExample log entries demonstrate the structure of a \u003ccode\u003eLogEntry\u003c/code\u003e for an \u003ccode\u003eUpdateVehicle\u003c/code\u003e log, including request and response details within the \u003ccode\u003ejsonPayload\u003c/code\u003e field.\u003c/p\u003e\n"],["\u003cp\u003eIn cases of RPC errors, the \u003ccode\u003eresponseVehicle\u003c/code\u003e field is cleared, and the \u003ccode\u003eerrorResponse\u003c/code\u003e field is populated within \u003ccode\u003ejsonPayload\u003c/code\u003e, containing error details like status code and message.\u003c/p\u003e\n"],["\u003cp\u003eAdditional resources are available for understanding the logging query language and utilizing logs to create metrics, with links provided for further exploration.\u003c/p\u003e\n"]]],["Cloud Logging uses the `LogEntry` data type, containing common data and service-specific payloads. Long logs are divided into multiple entries. The `jsonPayload` field within a `LogEntry` holds RPC requests and responses. If an RPC error occurs, the `responseVehicle` field is cleared, and the `errorResponse` field within the `jsonPayload` is populated with the error details. Logs can be queried using the Logging query language and used to create metrics.\n"],null,["Cloud Logging represents logs using the `LogEntry` data type, which\ndefines common data for all log entries as well as the specific payloads that\nGoogle Cloud services can include. For details, see [LogEntry](https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry).\n\nLong logs are split into multiple log entries. See [Handle split\nlogs](/maps/documentation/mobility/operations/cloud-logging/split-logs) in this documentation.\n\nExample log entries\n\nThe following example shows a `LogEntry` for the `UpdateVehicle` log. The RPC\nrequest and response are located inside the `jsonPayload` field. \n\n {\n \"insertId\": \"c6b85fbc927343fc8a85338c57a65733\",\n \"jsonPayload\": {\n \"request\": {\n \"header\": {4},\n \"updateMask\": \"deviceSettings\",\n \"vehicleId\": \"uniqueVehicleId\",\n \"vehicle\": {2}\n },\n \"response\": {\n \"name\": \"providers/example-project-id/vehicles/uniqueVehicleId\",\n \"availableCapacity\": 2,\n \"state\": \"VEHICLE_STATE_OFFLINE\",\n \"maximumCapacity\": 2,\n \"vehicleType\": {1},\n \"supportedTrips\": {1}\n },\n \"@type\": \"type.googleapis.com/maps.fleetengine.v1.UpdateVehicleLog\"\n },\n \"resource\": {\n \"type\": \"fleetengine.googleapis.com/Fleet\",\n \"labels\": {2}\n },\n \"timestamp\": \"2021-01-01T00:00:00.000000000Z\",\n \"labels\": {2},\n \"logName\": \"projects/example-project-id/logs/fleetengine.googleapis.com%2Fupdate_vehicle\",\n \"receiveTimestamp\": \"2021-01-01T00:00:00.000000000Z\"\n }\n\nIf an RPC error is returned, the `responseVehicle` field is cleared, and the\n`errorResponse` field is set and populated within `jsonPayload`. \n\n {\n \"insertId\": \"c6b85fbc927343fc8a85338c57a65733\",\n \"jsonPayload\": {\n \"errorResponse\": {\n \"httpStatusCode\": 404,\n \"code\": \"NOT_FOUND\",\n \"message\": \"No entity with id invalidVehicleId exists\"\n },\n \"@type\": \"type.googleapis.com/maps.fleetengine.v1.UpdateVehicleLog\",\n \"request\": {\n \"vehicle\": {3},\n \"updateMask\": \"deviceSettings\",\n \"vehicleId\": \"fakeVehicleId\",\n \"header\": {4}\n }\n },\n \"resource\": {\n \"type\": \"fleetengine.googleapis.com/Fleet\",\n \"labels\": {2}\n },\n \"timestamp\": \"2021-01-01T00:00:00.000000000Z\",\n \"severity\": \"ERROR\",\n \"labels\": {2}\n \"logName\": \"projects/example-project-id/logs/fleetengine.googleapis.com%2Fupdate_vehicle\",\n \"receiveTimestamp\": \"2021-01-01T00:00:00.000000000Z\"\n }\n\nFor more information about the logging query language, see [Logging query\nlanguage](https://cloud.google.com/logging/docs/view/logging-query-language).\n\nFor information about how you can use your logs to create metrics, see [Overview\nof logs-based metrics](https://cloud.google.com/logging/docs/logs-based-metrics).\n\nWhat's next\n\n[Handle long log entries with split logs](/maps/documentation/mobility/operations/cloud-logging/split-logs)."]]