ساختار گزارش ثبت ابر
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
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 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی."],[[["\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)."]]