Cloud Logging günlük yapısı
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Cloud Logging, günlükleri LogEntry
veri türünü kullanarak temsil eder. Bu veri türü, tüm günlük girişleri için ortak verileri ve Google Cloud hizmetlerinin içerebileceği belirli yükleri tanımlar. Ayrıntılar için LogEntry başlıklı makaleyi inceleyin.
Uzun günlükler birden fazla günlük girişine bölünür. Bu belgedeki Bölünmüş günlükleri işleme bölümüne bakın.
Örnek günlük girişleri
Aşağıdaki örnekte UpdateVehicle
günlüğü için bir LogEntry
gösterilmektedir. RPC isteği ve yanıtı jsonPayload
alanının içinde yer alır.
{
"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"
}
Bir TBG hatası döndürülürse responseVehicle
alanı temizlenir ve errorResponse
alanı jsonPayload
içinde ayarlanıp doldurulur.
{
"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"
}
Günlük sorgu dili hakkında daha fazla bilgi için Günlük sorgu dili başlıklı makaleyi inceleyin.
Metrik oluşturmak için günlüklerinizi nasıl kullanabileceğiniz hakkında bilgi edinmek için Günlük tabanlı metriklere genel bakış başlıklı makaleyi inceleyin.
Sırada ne var?
Bölünmüş günlüklerle uzun günlük girişlerini işleme.
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-08-31 UTC.
[null,null,["Son güncelleme tarihi: 2025-08-31 UTC."],[[["\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)."]]