Cloud Logging log structure

Cloud Logging represents logs using the LogEntry data type, which defines common data for all log entries as well as the specific payloads that Google Cloud services can include. For details, see LogEntry and Fleet Engine API Logging Integration.

Long logs are split into multiple log entries. See Handle split logs in this documentation.

Example log entries

The following example shows a LogEntry for the UpdateVehicle log. The RPC request and response are located inside the jsonPayload field.

    {
      "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"
    }

If an RPC error is returned, the responseVehicle field is cleared, and the errorResponse field is set and populated within 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"
    }

For more information about the logging query language, see Logging query language.

For information about how you can use your logs to create metrics, see Overview of logs-based metrics.

What's next

Handle long log entries with split logs.